Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: webrtc/system_wrappers/source/event_timer_posix.h

Issue 1812533002: Fix race condition in EventTimerPosix (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Test case was still racy Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/system_wrappers/source/event_timer_posix.h
diff --git a/webrtc/system_wrappers/source/event_timer_posix.h b/webrtc/system_wrappers/source/event_timer_posix.h
index bbf51f72db7b36c10ad412fa7f630f8ecec62d0b..af3715ee8b222186672f24eb031f2eb3827acd0b 100644
--- a/webrtc/system_wrappers/source/event_timer_posix.h
+++ b/webrtc/system_wrappers/source/event_timer_posix.h
@@ -37,11 +37,14 @@ class EventTimerPosix : public EventTimerWrapper {
bool StopTimer() override;
private:
+ friend class EventTimerPosixTest;
+
static bool Run(void* obj);
bool Process();
- EventTypeWrapper Wait(timespec* end_at);
+ EventTypeWrapper Wait(timespec* end_at, bool reset_state);
+
+ virtual rtc::PlatformThread* CreateThread();
- private:
pthread_cond_t cond_;
pthread_mutex_t mutex_;
bool event_set_;
@@ -52,8 +55,9 @@ class EventTimerPosix : public EventTimerWrapper {
timespec created_at_;
bool periodic_;
- unsigned long time_; // In ms
+ unsigned long time_ms_;
unsigned long count_;
+ bool is_stopping_;
};
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/system_wrappers/source/event_timer_posix.cc » ('j') | webrtc/system_wrappers/source/event_timer_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698