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

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

Issue 5977010: Move CancellationFlag and WaitableEvent to the synchronization subdirectory.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « base/synchronization/waitable_event_win.cc ('k') | base/threading/simple_thread_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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // WARNING: You should probably be using Thread (thread.h) instead. Thread is 5 // WARNING: You should probably be using Thread (thread.h) instead. Thread is
6 // Chrome's message-loop based Thread abstraction, and if you are a 6 // Chrome's message-loop based Thread abstraction, and if you are a
7 // thread running in the browser, there will likely be assumptions 7 // thread running in the browser, there will likely be assumptions
8 // that your thread will have an associated message loop. 8 // that your thread will have an associated message loop.
9 // 9 //
10 // This is a simple thread interface that backs to a native operating system 10 // This is a simple thread interface that backs to a native operating system
(...skipping 30 matching lines...) Expand all
41 #define BASE_THREADING_SIMPLE_THREAD_H_ 41 #define BASE_THREADING_SIMPLE_THREAD_H_
42 #pragma once 42 #pragma once
43 43
44 #include <string> 44 #include <string>
45 #include <queue> 45 #include <queue>
46 #include <vector> 46 #include <vector>
47 47
48 #include "base/basictypes.h" 48 #include "base/basictypes.h"
49 #include "base/lock.h" 49 #include "base/lock.h"
50 #include "base/threading/platform_thread.h" 50 #include "base/threading/platform_thread.h"
51 #include "base/waitable_event.h" 51 #include "base/synchronization/waitable_event.h"
52 52
53 namespace base { 53 namespace base {
54 54
55 // This is the base SimpleThread. You can derive from it and implement the 55 // This is the base SimpleThread. You can derive from it and implement the
56 // virtual Run method, or you can use the DelegateSimpleThread interface. 56 // virtual Run method, or you can use the DelegateSimpleThread interface.
57 class SimpleThread : public PlatformThread::Delegate { 57 class SimpleThread : public PlatformThread::Delegate {
58 public: 58 public:
59 class Options { 59 class Options {
60 public: 60 public:
61 Options() : stack_size_(0) { } 61 Options() : stack_size_(0) { }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 int num_threads_; 173 int num_threads_;
174 std::vector<DelegateSimpleThread*> threads_; 174 std::vector<DelegateSimpleThread*> threads_;
175 std::queue<Delegate*> delegates_; 175 std::queue<Delegate*> delegates_;
176 Lock lock_; // Locks delegates_ 176 Lock lock_; // Locks delegates_
177 WaitableEvent dry_; // Not signaled when there is no work to do. 177 WaitableEvent dry_; // Not signaled when there is no work to do.
178 }; 178 };
179 179
180 } // namespace base 180 } // namespace base
181 181
182 #endif // BASE_THREADING_SIMPLE_THREAD_H_ 182 #endif // BASE_THREADING_SIMPLE_THREAD_H_
OLDNEW
« no previous file with comments | « base/synchronization/waitable_event_win.cc ('k') | base/threading/simple_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698