| OLD | NEW |
| 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> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "base/base_export.h" | 12 #include "base/base_export.h" |
| 11 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 14 #include "base/message_loop/timer_slack.h" | 17 #include "base/message_loop/timer_slack.h" |
| 15 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 16 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
| 17 #include "base/synchronization/waitable_event.h" | 20 #include "base/synchronization/waitable_event.h" |
| 18 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
| 22 #include "build/build_config.h" |
| 19 | 23 |
| 20 namespace base { | 24 namespace base { |
| 21 | 25 |
| 22 class MessagePump; | 26 class MessagePump; |
| 23 | 27 |
| 24 // A simple thread abstraction that establishes a MessageLoop on a new thread. | 28 // A simple thread abstraction that establishes a MessageLoop on a new thread. |
| 25 // The consumer uses the MessageLoop of the thread to cause code to execute on | 29 // The consumer uses the MessageLoop of the thread to cause code to execute on |
| 26 // the thread. When this object is destroyed the thread is terminated. All | 30 // the thread. When this object is destroyed the thread is terminated. All |
| 27 // pending tasks queued on the thread's message loop will run to completion | 31 // pending tasks queued on the thread's message loop will run to completion |
| 28 // before the thread is terminated. | 32 // before the thread is terminated. |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 mutable WaitableEvent start_event_; | 252 mutable WaitableEvent start_event_; |
| 249 | 253 |
| 250 friend void ThreadQuitHelper(); | 254 friend void ThreadQuitHelper(); |
| 251 | 255 |
| 252 DISALLOW_COPY_AND_ASSIGN(Thread); | 256 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 253 }; | 257 }; |
| 254 | 258 |
| 255 } // namespace base | 259 } // namespace base |
| 256 | 260 |
| 257 #endif // BASE_THREADING_THREAD_H_ | 261 #endif // BASE_THREADING_THREAD_H_ |
| OLD | NEW |