thread/Cond: make the integer-based timed_wait() overload private
Make sure this deprecated API is not used.
This commit is contained in:
parent
2498a2b0bd
commit
a42021655c
@ -74,6 +74,7 @@ public:
|
|||||||
pthread_cond_wait(&cond, &mutex.mutex);
|
pthread_cond_wait(&cond, &mutex.mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
bool timed_wait(PosixMutex &mutex, unsigned timeout_ms) {
|
bool timed_wait(PosixMutex &mutex, unsigned timeout_ms) {
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
gettimeofday(&now, nullptr);
|
gettimeofday(&now, nullptr);
|
||||||
@ -90,6 +91,7 @@ public:
|
|||||||
return pthread_cond_timedwait(&cond, &mutex.mutex, &ts) == 0;
|
return pthread_cond_timedwait(&cond, &mutex.mutex, &ts) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
bool timed_wait(PosixMutex &mutex,
|
bool timed_wait(PosixMutex &mutex,
|
||||||
std::chrono::steady_clock::duration timeout) {
|
std::chrono::steady_clock::duration timeout) {
|
||||||
auto timeout_ms = std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count();
|
auto timeout_ms = std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count();
|
||||||
|
@ -56,11 +56,13 @@ public:
|
|||||||
WakeAllConditionVariable(&cond);
|
WakeAllConditionVariable(&cond);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
bool timed_wait(CriticalSection &mutex, DWORD timeout_ms) {
|
bool timed_wait(CriticalSection &mutex, DWORD timeout_ms) {
|
||||||
return SleepConditionVariableCS(&cond, &mutex.critical_section,
|
return SleepConditionVariableCS(&cond, &mutex.critical_section,
|
||||||
timeout_ms);
|
timeout_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
bool timed_wait(CriticalSection &mutex,
|
bool timed_wait(CriticalSection &mutex,
|
||||||
std::chrono::steady_clock::duration timeout) {
|
std::chrono::steady_clock::duration timeout) {
|
||||||
auto timeout_ms = std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count();
|
auto timeout_ms = std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count();
|
||||||
|
Loading…
Reference in New Issue
Block a user