From b37f1aa6398065be806e6605a023189685669885 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 15 Feb 2017 03:55:15 +0200 Subject: Implement parallel match --- build2/scope | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'build2/scope') 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 (*this);} + rw () const + { + assert (phase == run_phase::load); + return const_cast (*this); + } // RW access to global scope (RO via global global_scope below). // @@ -340,11 +344,15 @@ namespace build2 return find (path_cast (p)); } - // Proof of lock for RW access. + // RW access. // public: scope_map& - rw (ulock&) const {return const_cast (*this);} + rw () const + { + assert (phase == run_phase::load); + return const_cast (*this); + } scope_map& rw (scope&) const {return const_cast (*this);} -- cgit v1.1