From ca6a61f432f3ff0257e868bed36a58540623ab49 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 11 Dec 2020 20:53:32 +0300 Subject: Fix bug in create_new_target_locked() --- libbuild2/target.ixx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libbuild2/target.ixx') diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx index df1cf5b..2d1906e 100644 --- a/libbuild2/target.ixx +++ b/libbuild2/target.ixx @@ -12,10 +12,16 @@ namespace build2 // target // inline const string* target:: + ext_locked () const + { + return *ext_ ? &**ext_ : nullptr; + } + + inline const string* target:: ext () const { slock l (ctx.targets.mutex_); - return *ext_ ? &**ext_ : nullptr; + return ext_locked (); } inline target_key target:: @@ -30,6 +36,18 @@ namespace build2 e != nullptr ? optional (*e) : nullopt}; } + inline target_key target:: + key_locked () const + { + const string* e (ext_locked ()); + return target_key { + &type (), + &dir, + &out, + &name, + e != nullptr ? optional (*e) : nullopt}; + } + inline names target:: as_name () const { -- cgit v1.1