diff options
author | Max Kellermann <max@duempel.org> | 2013-04-17 01:33:07 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-04-17 01:33:07 +0200 |
commit | c5c43c4541f4434b4c5a5bc5914d6bc08f75ea94 (patch) | |
tree | 1705020ab31359e019b89c75cab740dbfd5f9511 /src/thread/WindowsCond.hxx | |
parent | 0954f580fa62ce52bb63739e7624f8b3f97546a6 (diff) | |
download | mpd-c5c43c4541f4434b4c5a5bc5914d6bc08f75ea94.tar.gz mpd-c5c43c4541f4434b4c5a5bc5914d6bc08f75ea94.tar.xz mpd-c5c43c4541f4434b4c5a5bc5914d6bc08f75ea94.zip |
thread/Cond: add method timed_wait()
Diffstat (limited to '')
-rw-r--r-- | src/thread/WindowsCond.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/thread/WindowsCond.hxx b/src/thread/WindowsCond.hxx index f4e909c72..c05bc05b2 100644 --- a/src/thread/WindowsCond.hxx +++ b/src/thread/WindowsCond.hxx @@ -54,9 +54,13 @@ public: WakeAllConditionVariable(&cond); } + bool timed_wait(CriticalSection &mutex, DWORD timeout_ms) { + return SleepConditionVariableCS(&cond, &mutex.critical_section, + timeout_ms); + } + void wait(CriticalSection &mutex) { - SleepConditionVariableCS(&cond, &mutex.critical_section, - INFINITE); + timed_wait(mutex, INFINITE); } }; |