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

Side by Side Diff: base/threading/thread.cc

Issue 2032603002: Migrate WaitableEvent to enum-based constructor in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: undo incorrect template change Created 4 years, 6 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 | « base/threading/simple_thread_unittest.cc ('k') | base/threading/thread_local_unittest.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/thread.h" 5 #include "base/threading/thread.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 Thread::Thread(const std::string& name) 60 Thread::Thread(const std::string& name)
61 : 61 :
62 #if defined(OS_WIN) 62 #if defined(OS_WIN)
63 com_status_(NONE), 63 com_status_(NONE),
64 #endif 64 #endif
65 stopping_(false), 65 stopping_(false),
66 running_(false), 66 running_(false),
67 thread_(0), 67 thread_(0),
68 id_(kInvalidThreadId), 68 id_(kInvalidThreadId),
69 id_event_(true, false), 69 id_event_(WaitableEvent::ResetPolicy::MANUAL,
70 WaitableEvent::InitialState::NOT_SIGNALED),
70 message_loop_(nullptr), 71 message_loop_(nullptr),
71 message_loop_timer_slack_(TIMER_SLACK_NONE), 72 message_loop_timer_slack_(TIMER_SLACK_NONE),
72 name_(name), 73 name_(name),
73 start_event_(true, false) { 74 start_event_(WaitableEvent::ResetPolicy::MANUAL,
75 WaitableEvent::InitialState::NOT_SIGNALED) {
74 } 76 }
75 77
76 Thread::~Thread() { 78 Thread::~Thread() {
77 Stop(); 79 Stop();
78 } 80 }
79 81
80 bool Thread::Start() { 82 bool Thread::Start() {
81 Options options; 83 Options options;
82 #if defined(OS_WIN) 84 #if defined(OS_WIN)
83 if (com_status_ == STA) 85 if (com_status_ == STA)
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // allow this. 273 // allow this.
272 DCHECK(GetThreadWasQuitProperly()); 274 DCHECK(GetThreadWasQuitProperly());
273 } 275 }
274 276
275 // We can't receive messages anymore. 277 // We can't receive messages anymore.
276 // (The message loop is destructed at the end of this block) 278 // (The message loop is destructed at the end of this block)
277 message_loop_ = nullptr; 279 message_loop_ = nullptr;
278 } 280 }
279 281
280 } // namespace base 282 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/simple_thread_unittest.cc ('k') | base/threading/thread_local_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698