Unique lock on event set and reset.

This commit is contained in:
OBattler
2021-12-17 19:14:28 +01:00
parent 57f879ba0b
commit ea88934c21

View File

@@ -109,7 +109,7 @@ void
thread_set_event(event_t *handle)
{
auto event = reinterpret_cast<event_cpp11_t*>(handle);
std::lock_guard<std::mutex> lock(event->mutex);
std::unique_lock<std::mutex> 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<event_cpp11_t*>(handle);
std::lock_guard<std::mutex> lock(event->mutex);
std::unique_lock<std::mutex> lock(event->mutex);
event->state = false;
}