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

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

Issue 2182643002: Re-enable Thread::Stop() sequence checks and consequently remove |thread_lock|. Base URL: https://chromium.googlesource.com/chromium/src.git@a0_a_1_memorydumpmanagertests
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 | base/threading/thread.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 #ifndef BASE_THREADING_THREAD_H_ 5 #ifndef BASE_THREADING_THREAD_H_
6 #define BASE_THREADING_THREAD_H_ 6 #define BASE_THREADING_THREAD_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Should be written on the thread that created this thread. Also read data 257 // Should be written on the thread that created this thread. Also read data
258 // could be wrong on other threads. 258 // could be wrong on other threads.
259 bool stopping_ = false; 259 bool stopping_ = false;
260 260
261 // True while inside of Run(). 261 // True while inside of Run().
262 bool running_ = false; 262 bool running_ = false;
263 mutable base::Lock running_lock_; // Protects |running_|. 263 mutable base::Lock running_lock_; // Protects |running_|.
264 264
265 // The thread's handle. 265 // The thread's handle.
266 PlatformThreadHandle thread_; 266 PlatformThreadHandle thread_;
267 mutable base::Lock thread_lock_; // Protects |thread_|.
268 267
269 // The thread's id once it has started. 268 // The thread's id once it has started.
270 PlatformThreadId id_ = kInvalidThreadId; 269 PlatformThreadId id_ = kInvalidThreadId;
271 mutable WaitableEvent id_event_; // Protects |id_|. 270 mutable WaitableEvent id_event_; // Protects |id_|.
272 271
273 // The thread's MessageLoop and RunLoop. Valid only while the thread is alive. 272 // The thread's MessageLoop and RunLoop. Valid only while the thread is alive.
274 // Set by the created thread. 273 // Set by the created thread.
275 MessageLoop* message_loop_ = nullptr; 274 MessageLoop* message_loop_ = nullptr;
276 RunLoop* run_loop_ = nullptr; 275 RunLoop* run_loop_ = nullptr;
277 276
(...skipping 10 matching lines...) Expand all
288 // This class is not thread-safe, use this to verify access from the owning 287 // This class is not thread-safe, use this to verify access from the owning
289 // sequence of the Thread. 288 // sequence of the Thread.
290 SequenceChecker owning_sequence_checker_; 289 SequenceChecker owning_sequence_checker_;
291 290
292 DISALLOW_COPY_AND_ASSIGN(Thread); 291 DISALLOW_COPY_AND_ASSIGN(Thread);
293 }; 292 };
294 293
295 } // namespace base 294 } // namespace base
296 295
297 #endif // BASE_THREADING_THREAD_H_ 296 #endif // BASE_THREADING_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | base/threading/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698