| Index: webrtc/system_wrappers/source/condition_variable_posix.cc
|
| diff --git a/webrtc/system_wrappers/source/condition_variable_posix.cc b/webrtc/system_wrappers/source/condition_variable_posix.cc
|
| index b21304245cd832d70ff33c23ee2403327c2f076f..c2de4e36a06b8c20fc6e5cb8dca924d3c36a7c81 100644
|
| --- a/webrtc/system_wrappers/source/condition_variable_posix.cc
|
| +++ b/webrtc/system_wrappers/source/condition_variable_posix.cc
|
| @@ -10,6 +10,8 @@
|
|
|
| #include "webrtc/system_wrappers/source/condition_variable_posix.h"
|
|
|
| +#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
| +
|
| #include <errno.h>
|
| #if defined(WEBRTC_LINUX)
|
| #include <time.h>
|
| @@ -17,8 +19,6 @@
|
| #include <sys/time.h>
|
| #endif
|
|
|
| -#include "webrtc/system_wrappers/source/critical_section_posix.h"
|
| -
|
| namespace webrtc {
|
|
|
| ConditionVariableWrapper* ConditionVariablePosix::Create() {
|
| @@ -70,9 +70,7 @@ ConditionVariablePosix::~ConditionVariablePosix() {
|
| }
|
|
|
| void ConditionVariablePosix::SleepCS(CriticalSectionWrapper& crit_sect) {
|
| - CriticalSectionPosix* cs = reinterpret_cast<CriticalSectionPosix*>(
|
| - &crit_sect);
|
| - pthread_cond_wait(&cond_, &cs->mutex_);
|
| + pthread_cond_wait(&cond_, &crit_sect.mutex_);
|
| }
|
|
|
| bool ConditionVariablePosix::SleepCS(CriticalSectionWrapper& crit_sect,
|
| @@ -85,9 +83,6 @@ bool ConditionVariablePosix::SleepCS(CriticalSectionWrapper& crit_sect,
|
| const int NANOSECONDS_PER_SECOND = 1000000000;
|
| const int NANOSECONDS_PER_MILLISECOND = 1000000;
|
|
|
| - CriticalSectionPosix* cs = reinterpret_cast<CriticalSectionPosix*>(
|
| - &crit_sect);
|
| -
|
| if (max_time_inMS != INFINITE) {
|
| timespec ts;
|
| #ifndef WEBRTC_MAC
|
| @@ -113,10 +108,10 @@ bool ConditionVariablePosix::SleepCS(CriticalSectionWrapper& crit_sect,
|
| ts.tv_sec += ts.tv_nsec / NANOSECONDS_PER_SECOND;
|
| ts.tv_nsec %= NANOSECONDS_PER_SECOND;
|
| }
|
| - const int res = pthread_cond_timedwait(&cond_, &cs->mutex_, &ts);
|
| + const int res = pthread_cond_timedwait(&cond_, &crit_sect.mutex_, &ts);
|
| return (res == ETIMEDOUT) ? false : true;
|
| } else {
|
| - pthread_cond_wait(&cond_, &cs->mutex_);
|
| + pthread_cond_wait(&cond_, &crit_sect.mutex_);
|
| return true;
|
| }
|
| }
|
|
|