OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SYNCHRONIZATION_CANCELLATION_FLAG_H_ | 5 #ifndef BASE_SYNCHRONIZATION_CANCELLATION_FLAG_H_ |
6 #define BASE_SYNCHRONIZATION_CANCELLATION_FLAG_H_ | 6 #define BASE_SYNCHRONIZATION_CANCELLATION_FLAG_H_ |
7 | 7 |
| 8 #include "base/atomicops.h" |
8 #include "base/base_export.h" | 9 #include "base/base_export.h" |
9 #include "base/atomicops.h" | 10 #include "base/macros.h" |
10 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 | 14 |
14 // CancellationFlag allows one thread to cancel jobs executed on some worker | 15 // CancellationFlag allows one thread to cancel jobs executed on some worker |
15 // thread. Calling Set() from one thread and IsSet() from a number of threads | 16 // thread. Calling Set() from one thread and IsSet() from a number of threads |
16 // is thread-safe. | 17 // is thread-safe. |
17 // | 18 // |
18 // This class IS NOT intended for synchronization between threads. | 19 // This class IS NOT intended for synchronization between threads. |
19 class BASE_EXPORT CancellationFlag { | 20 class BASE_EXPORT CancellationFlag { |
(...skipping 19 matching lines...) Expand all Loading... |
39 #if !defined(NDEBUG) | 40 #if !defined(NDEBUG) |
40 PlatformThreadId set_on_; | 41 PlatformThreadId set_on_; |
41 #endif | 42 #endif |
42 | 43 |
43 DISALLOW_COPY_AND_ASSIGN(CancellationFlag); | 44 DISALLOW_COPY_AND_ASSIGN(CancellationFlag); |
44 }; | 45 }; |
45 | 46 |
46 } // namespace base | 47 } // namespace base |
47 | 48 |
48 #endif // BASE_SYNCHRONIZATION_CANCELLATION_FLAG_H_ | 49 #endif // BASE_SYNCHRONIZATION_CANCELLATION_FLAG_H_ |
OLD | NEW |