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

Side by Side Diff: webrtc/base/messagequeue.h

Issue 2135173002: Revert of Protect MessageQueue stop field with a critical section to avoid data races. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | webrtc/base/messagequeue.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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // Perform initialization, subclasses must call this from their constructor 281 // Perform initialization, subclasses must call this from their constructor
282 // if false was passed as init_queue to the MessageQueue constructor. 282 // if false was passed as init_queue to the MessageQueue constructor.
283 void DoInit(); 283 void DoInit();
284 284
285 // Perform cleanup, subclasses that override Clear must call this from the 285 // Perform cleanup, subclasses that override Clear must call this from the
286 // destructor. 286 // destructor.
287 void DoDestroy(); 287 void DoDestroy();
288 288
289 void WakeUpSocketServer(); 289 void WakeUpSocketServer();
290 290
291 bool fStop_;
291 bool fPeekKeep_; 292 bool fPeekKeep_;
292 Message msgPeek_; 293 Message msgPeek_;
293 MessageList msgq_ GUARDED_BY(crit_); 294 MessageList msgq_ GUARDED_BY(crit_);
294 PriorityQueue dmsgq_ GUARDED_BY(crit_); 295 PriorityQueue dmsgq_ GUARDED_BY(crit_);
295 uint32_t dmsgq_next_num_ GUARDED_BY(crit_); 296 uint32_t dmsgq_next_num_ GUARDED_BY(crit_);
296 CriticalSection crit_; 297 CriticalSection crit_;
297 bool fInitialized_; 298 bool fInitialized_;
298 bool fDestroyed_; 299 bool fDestroyed_;
299 300
300 private: 301 private:
301 volatile int stop_;
302
303 // The SocketServer might not be owned by MessageQueue. 302 // The SocketServer might not be owned by MessageQueue.
304 SocketServer* ss_ GUARDED_BY(ss_lock_); 303 SocketServer* ss_ GUARDED_BY(ss_lock_);
305 // Used if SocketServer ownership lies with |this|. 304 // Used if SocketServer ownership lies with |this|.
306 std::unique_ptr<SocketServer> own_ss_; 305 std::unique_ptr<SocketServer> own_ss_;
307 SharedExclusiveLock ss_lock_; 306 SharedExclusiveLock ss_lock_;
308 307
309 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue); 308 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue);
310 }; 309 };
311 310
312 } // namespace rtc 311 } // namespace rtc
313 312
314 #endif // WEBRTC_BASE_MESSAGEQUEUE_H_ 313 #endif // WEBRTC_BASE_MESSAGEQUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/messagequeue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698