diff --git a/src/cpp11_thread.cpp b/src/cpp11_thread.cpp index 2b56ae2f6..3185e574d 100644 --- a/src/cpp11_thread.cpp +++ b/src/cpp11_thread.cpp @@ -109,7 +109,7 @@ void thread_set_event(event_t *handle) { auto event = reinterpret_cast(handle); - std::lock_guard lock(event->mutex); + std::unique_lock lock(event->mutex); event->state = true; event->cond.notify_all(); @@ -119,7 +119,7 @@ void thread_reset_event(event_t *handle) { auto event = reinterpret_cast(handle); - std::lock_guard lock(event->mutex); + std::unique_lock lock(event->mutex); event->state = false; }