diff options
Diffstat (limited to 'build2/scheduler.hxx')
-rw-r--r-- | build2/scheduler.hxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/build2/scheduler.hxx b/build2/scheduler.hxx index 33d0709..9e057b1 100644 --- a/build2/scheduler.hxx +++ b/build2/scheduler.hxx @@ -240,18 +240,7 @@ namespace build2 { explicit monitor_guard (scheduler* s = nullptr): s_ (s) {} - - ~monitor_guard () - { - if (s_ != nullptr) - { - s_->monitor_count_ = nullptr; - s_->monitor_func_ = nullptr; - } - } - monitor_guard (monitor_guard&& x): s_ (x.s_) {x.s_ = nullptr;} - monitor_guard& operator= (monitor_guard&& x) { if (&x != this) @@ -262,6 +251,17 @@ namespace build2 return *this; } + ~monitor_guard () + { + if (s_ != nullptr) + { + s_->monitor_count_ = nullptr; + s_->monitor_func_ = nullptr; + } + } + + explicit operator bool () const {return s_ != nullptr;} + private: scheduler* s_; }; |