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

Side by Side Diff: webrtc/base/event.cc

Issue 1335923002: Add RTC_ prefix to (D)CHECKs and related macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/criticalsection.cc ('k') | webrtc/base/filerotatingstream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 13 matching lines...) Expand all
24 24
25 namespace rtc { 25 namespace rtc {
26 26
27 #if defined(WEBRTC_WIN) 27 #if defined(WEBRTC_WIN)
28 28
29 Event::Event(bool manual_reset, bool initially_signaled) { 29 Event::Event(bool manual_reset, bool initially_signaled) {
30 event_handle_ = ::CreateEvent(NULL, // Security attributes. 30 event_handle_ = ::CreateEvent(NULL, // Security attributes.
31 manual_reset, 31 manual_reset,
32 initially_signaled, 32 initially_signaled,
33 NULL); // Name. 33 NULL); // Name.
34 CHECK(event_handle_); 34 RTC_CHECK(event_handle_);
35 } 35 }
36 36
37 Event::~Event() { 37 Event::~Event() {
38 CloseHandle(event_handle_); 38 CloseHandle(event_handle_);
39 } 39 }
40 40
41 void Event::Set() { 41 void Event::Set() {
42 SetEvent(event_handle_); 42 SetEvent(event_handle_);
43 } 43 }
44 44
45 void Event::Reset() { 45 void Event::Reset() {
46 ResetEvent(event_handle_); 46 ResetEvent(event_handle_);
47 } 47 }
48 48
49 bool Event::Wait(int milliseconds) { 49 bool Event::Wait(int milliseconds) {
50 DWORD ms = (milliseconds == kForever) ? INFINITE : milliseconds; 50 DWORD ms = (milliseconds == kForever) ? INFINITE : milliseconds;
51 return (WaitForSingleObject(event_handle_, ms) == WAIT_OBJECT_0); 51 return (WaitForSingleObject(event_handle_, ms) == WAIT_OBJECT_0);
52 } 52 }
53 53
54 #elif defined(WEBRTC_POSIX) 54 #elif defined(WEBRTC_POSIX)
55 55
56 Event::Event(bool manual_reset, bool initially_signaled) 56 Event::Event(bool manual_reset, bool initially_signaled)
57 : is_manual_reset_(manual_reset), 57 : is_manual_reset_(manual_reset),
58 event_status_(initially_signaled) { 58 event_status_(initially_signaled) {
59 CHECK(pthread_mutex_init(&event_mutex_, NULL) == 0); 59 RTC_CHECK(pthread_mutex_init(&event_mutex_, NULL) == 0);
60 CHECK(pthread_cond_init(&event_cond_, NULL) == 0); 60 RTC_CHECK(pthread_cond_init(&event_cond_, NULL) == 0);
61 } 61 }
62 62
63 Event::~Event() { 63 Event::~Event() {
64 pthread_mutex_destroy(&event_mutex_); 64 pthread_mutex_destroy(&event_mutex_);
65 pthread_cond_destroy(&event_cond_); 65 pthread_cond_destroy(&event_cond_);
66 } 66 }
67 67
68 void Event::Set() { 68 void Event::Set() {
69 pthread_mutex_lock(&event_mutex_); 69 pthread_mutex_lock(&event_mutex_);
70 event_status_ = true; 70 event_status_ = true;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 event_status_ = false; 126 event_status_ = false;
127 127
128 pthread_mutex_unlock(&event_mutex_); 128 pthread_mutex_unlock(&event_mutex_);
129 129
130 return (error == 0); 130 return (error == 0);
131 } 131 }
132 132
133 #endif 133 #endif
134 134
135 } // namespace rtc 135 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/criticalsection.cc ('k') | webrtc/base/filerotatingstream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698