diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-12 18:27:24 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-12 18:27:24 +0000 |
commit | e072003cb1cc8d863ed0766fac78e6fb46b80176 (patch) | |
tree | 140ead97b0d81168f76a13f4db773b32efae1bae /storageframework | |
parent | 01de6039781e8064d0846b41843b1b26133319cc (diff) |
vespalib::Monitor -> std::mutex and std::condition_variable
Diffstat (limited to 'storageframework')
-rw-r--r-- | storageframework/src/vespa/storageframework/generic/thread/thread.cpp | 11 | ||||
-rw-r--r-- | storageframework/src/vespa/storageframework/generic/thread/thread.h | 3 |
2 files changed, 5 insertions, 9 deletions
diff --git a/storageframework/src/vespa/storageframework/generic/thread/thread.cpp b/storageframework/src/vespa/storageframework/generic/thread/thread.cpp index 5ed3f7dc5e6..2a53b1de329 100644 --- a/storageframework/src/vespa/storageframework/generic/thread/thread.cpp +++ b/storageframework/src/vespa/storageframework/generic/thread/thread.cpp @@ -3,14 +3,13 @@ #include "thread.h" #include <vespa/vespalib/util/sync.h> -namespace storage { -namespace framework { +namespace storage::framework { void Thread::interruptAndJoin(vespalib::Monitor* m) { interrupt(); - if (m != 0) { + if (m != nullptr) { vespalib::MonitorGuard monitorGuard(*m); monitorGuard.broadcast(); } @@ -18,15 +17,13 @@ Thread::interruptAndJoin(vespalib::Monitor* m) } void -Thread::interruptAndJoin(std::mutex &m, std::condition_variable &cv) +Thread::interruptAndJoin(std::condition_variable &cv) { interrupt(); { - std::lock_guard<std::mutex> guard(m); cv.notify_all(); } join(); } -} // framework -} // storage +} diff --git a/storageframework/src/vespa/storageframework/generic/thread/thread.h b/storageframework/src/vespa/storageframework/generic/thread/thread.h index 72054ff725a..26c59ce1330 100644 --- a/storageframework/src/vespa/storageframework/generic/thread/thread.h +++ b/storageframework/src/vespa/storageframework/generic/thread/thread.h @@ -14,7 +14,6 @@ #include "runnable.h" #include <vespa/vespalib/stllike/string.h> -#include <mutex> #include <condition_variable> namespace vespalib { @@ -61,7 +60,7 @@ public: */ void interruptAndJoin(vespalib::Monitor* m); - void interruptAndJoin(std::mutex &m, std::condition_variable &cv); + void interruptAndJoin(std::condition_variable &cv); }; } |