summaryrefslogtreecommitdiff
path: root/src/thread/WindowsCond.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-04-25 18:33:09 +0200
committerMax Kellermann <max@musicpd.org>2019-04-25 19:46:43 +0200
commitb51bae5500f8c9cc37708ca5130c9ee9866a0704 (patch)
tree8980f518daedc24a3b3f548738884e59aadd0d32 /src/thread/WindowsCond.hxx
parent5bc8cd0ecbc06ed46335e01037412a66fd3811ae (diff)
thread/*Cond: rename methods to match std::condition_variable
Diffstat (limited to 'src/thread/WindowsCond.hxx')
-rw-r--r--src/thread/WindowsCond.hxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/thread/WindowsCond.hxx b/src/thread/WindowsCond.hxx
index 108f38c81..ef2777baf 100644
--- a/src/thread/WindowsCond.hxx
+++ b/src/thread/WindowsCond.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2013 Max Kellermann <max.kellermann@gmail.com>
+ * Copyright 2009-2019 Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -48,29 +48,29 @@ public:
WindowsCond(const WindowsCond &other) = delete;
WindowsCond &operator=(const WindowsCond &other) = delete;
- void signal() noexcept {
+ void notify_one() noexcept {
WakeConditionVariable(&cond);
}
- void broadcast() noexcept {
+ void notify_all() noexcept {
WakeAllConditionVariable(&cond);
}
private:
- bool timed_wait(CriticalSection &mutex, DWORD timeout_ms) noexcept {
+ bool wait_for(CriticalSection &mutex, DWORD timeout_ms) noexcept {
return SleepConditionVariableCS(&cond, &mutex.critical_section,
timeout_ms);
}
public:
- bool timed_wait(CriticalSection &mutex,
- std::chrono::steady_clock::duration timeout) noexcept {
+ bool wait_for(CriticalSection &mutex,
+ std::chrono::steady_clock::duration timeout) noexcept {
auto timeout_ms = std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count();
- return timed_wait(mutex, timeout_ms);
+ return wait_for(mutex, timeout_ms);
}
void wait(CriticalSection &mutex) noexcept {
- timed_wait(mutex, INFINITE);
+ wait_for(mutex, INFINITE);
}
};