aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/windows-rpath.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-06-02 06:10:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-06-02 06:10:34 +0200
commit048bcc1604a7e8aca666e219c0fdc3cd5517029e (patch)
treec710fd799f1089cfaf06cf1a520c072c0436dfd1 /libbuild2/cc/windows-rpath.cxx
parent2dd1f9fa5a7427096b74aa85258ec2feeb93c104 (diff)
Fix data race in library metadata protocol logic
Diffstat (limited to 'libbuild2/cc/windows-rpath.cxx')
-rw-r--r--libbuild2/cc/windows-rpath.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/libbuild2/cc/windows-rpath.cxx b/libbuild2/cc/windows-rpath.cxx
index 9387078..bd5a928 100644
--- a/libbuild2/cc/windows-rpath.cxx
+++ b/libbuild2/cc/windows-rpath.cxx
@@ -128,7 +128,9 @@ namespace build2
library_cache lib_cache;
for (const prerequisite_target& pt: t.prerequisite_targets[a])
{
- if (pt == nullptr || pt.adhoc ())
+ // Note: during execute so check for ad hoc first to avoid data races.
+ //
+ if (pt.adhoc () || pt == nullptr)
continue;
bool la;
@@ -255,7 +257,9 @@ namespace build2
library_cache lib_cache;
for (const prerequisite_target& pt: t.prerequisite_targets[a])
{
- if (pt == nullptr || pt.adhoc ())
+ // Note: during execute so check for ad hoc first to avoid data races.
+ //
+ if (pt.adhoc () || pt == nullptr)
continue;
bool la;