diff options
Diffstat (limited to 'src/mongo/util/clock_source.cpp')
-rw-r--r-- | src/mongo/util/clock_source.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/util/clock_source.cpp b/src/mongo/util/clock_source.cpp index 6e81e0708fa..6f54a1bcc76 100644 --- a/src/mongo/util/clock_source.cpp +++ b/src/mongo/util/clock_source.cpp @@ -27,10 +27,10 @@ * it in the license file. */ +#include "mongo/util/clock_source.h" #include "mongo/platform/basic.h" - +#include "mongo/platform/mutex.h" #include "mongo/stdx/thread.h" -#include "mongo/util/clock_source.h" #include "mongo/util/waitable.h" namespace mongo { @@ -55,7 +55,7 @@ stdx::cv_status ClockSource::waitForConditionUntil(stdx::condition_variable& cv, } struct AlarmInfo { - stdx::mutex controlMutex; + Mutex controlMutex = MONGO_MAKE_LATCH("AlarmInfo::controlMutex"); BasicLockableAdapter* waitLock; stdx::condition_variable* waitCV; stdx::cv_status cvWaitResult = stdx::cv_status::no_timeout; @@ -66,7 +66,7 @@ stdx::cv_status ClockSource::waitForConditionUntil(stdx::condition_variable& cv, const auto waiterThreadId = stdx::this_thread::get_id(); bool invokedAlarmInline = false; invariant(setAlarm(deadline, [alarmInfo, waiterThreadId, &invokedAlarmInline] { - stdx::lock_guard<stdx::mutex> controlLk(alarmInfo->controlMutex); + stdx::lock_guard<Latch> controlLk(alarmInfo->controlMutex); alarmInfo->cvWaitResult = stdx::cv_status::timeout; if (!alarmInfo->waitLock) { return; @@ -86,7 +86,7 @@ stdx::cv_status ClockSource::waitForConditionUntil(stdx::condition_variable& cv, Waitable::wait(waitable, this, cv, m); } m.unlock(); - stdx::lock_guard<stdx::mutex> controlLk(alarmInfo->controlMutex); + stdx::lock_guard<Latch> controlLk(alarmInfo->controlMutex); m.lock(); alarmInfo->waitLock = nullptr; alarmInfo->waitCV = nullptr; |