Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 EventTypeWrapper Wait(unsigned long max_time) override; | 33 EventTypeWrapper Wait(unsigned long max_time) override; |
| 34 bool Set() override; | 34 bool Set() override; |
| 35 | 35 |
| 36 bool StartTimer(bool periodic, unsigned long time) override; | 36 bool StartTimer(bool periodic, unsigned long time) override; |
| 37 bool StopTimer() override; | 37 bool StopTimer() override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 static bool Run(void* obj); | 40 static bool Run(void* obj); |
| 41 bool Process(); | 41 bool Process(); |
| 42 EventTypeWrapper Wait(timespec* end_at); | 42 EventTypeWrapper Wait(timespec* end_at, bool reset_state); |
| 43 | 43 |
| 44 private: | 44 virtual rtc::PlatformThread* CreateThread(); |
| 45 | |
| 45 pthread_cond_t cond_; | 46 pthread_cond_t cond_; |
| 46 pthread_mutex_t mutex_; | 47 pthread_mutex_t mutex_; |
| 47 bool event_set_; | 48 bool event_set_; |
| 48 | 49 |
| 49 // TODO(pbos): Remove scoped_ptr and use PlatformThread directly. | 50 // TODO(pbos): Remove scoped_ptr and use PlatformThread directly. |
| 50 rtc::scoped_ptr<rtc::PlatformThread> timer_thread_; | 51 rtc::scoped_ptr<rtc::PlatformThread> timer_thread_; |
| 51 rtc::scoped_ptr<EventTimerPosix> timer_event_; | 52 rtc::scoped_ptr<EventTimerPosix> timer_event_; |
| 52 timespec created_at_; | 53 timespec created_at_; |
| 53 | 54 |
| 54 bool periodic_; | 55 bool periodic_; |
| 55 unsigned long time_; // In ms | 56 unsigned long time_ms_; |
| 56 unsigned long count_; | 57 unsigned long count_; |
| 58 bool is_stopping_; | |
| 59 | |
| 60 friend class EventTimerPosixTest; | |
|
mflodman
2016/03/18 09:19:23
This is normally put directly on the line after 'p
sprang_webrtc
2016/03/18 09:24:28
Done.
| |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 } // namespace webrtc | 63 } // namespace webrtc |
| 60 | 64 |
| 61 #endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_POSIX_H_ | 65 #endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_POSIX_H_ |
| OLD | NEW |