Fix potential race in dispatcher wakeup

This commit is contained in:
Eelco Dolstra
2015-08-10 11:58:33 +02:00
parent 6a1c950e94
commit 593850b956
3 changed files with 22 additions and 8 deletions

View File

@@ -202,8 +202,8 @@ private:
Sync<Runnable> runnable;
/* CV for waking up the dispatcher. */
std::condition_variable dispatcherWakeup;
std::mutex dispatcherMutex;
Sync<bool> dispatcherWakeup;
std::condition_variable_any dispatcherWakeupCV;
/* PostgreSQL connection pool. */
Pool<Connection> dbPool;