aboutsummaryrefslogtreecommitdiff
path: root/build2/scope
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-15 03:55:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-02 14:03:34 +0200
commitb37f1aa6398065be806e6605a023189685669885 (patch)
treeb9b32091e3d70a31852302b24c99ecb62465464a /build2/scope
parenta64b2ae2099346471ead988d5f2d383d55a9bf89 (diff)
Implement parallel match
Diffstat (limited to 'build2/scope')
-rw-r--r--build2/scope16
1 files changed, 12 insertions, 4 deletions
diff --git a/build2/scope b/build2/scope
index b172965..c15d973 100644
--- a/build2/scope
+++ b/build2/scope
@@ -246,10 +246,14 @@ namespace build2
loaded_module_map modules; // Only on root scope.
public:
- // Proof of lock for RW access.
+ // RW access.
//
scope&
- rw (const ulock&) const {return const_cast<scope&> (*this);}
+ rw () const
+ {
+ assert (phase == run_phase::load);
+ return const_cast<scope&> (*this);
+ }
// RW access to global scope (RO via global global_scope below).
//
@@ -340,11 +344,15 @@ namespace build2
return find (path_cast<dir_path> (p));
}
- // Proof of lock for RW access.
+ // RW access.
//
public:
scope_map&
- rw (ulock&) const {return const_cast<scope_map&> (*this);}
+ rw () const
+ {
+ assert (phase == run_phase::load);
+ return const_cast<scope_map&> (*this);
+ }
scope_map&
rw (scope&) const {return const_cast<scope_map&> (*this);}