OLD | NEW |
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 #ifndef BASE_THREAD_RESTRICTIONS_H_ | 5 #ifndef BASE_THREADING_THREAD_RESTRICTIONS_H_ |
6 #define BASE_THREAD_RESTRICTIONS_H_ | 6 #define BASE_THREADING_THREAD_RESTRICTIONS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 | 11 |
12 // Certain behavior is disallowed on certain threads. ThreadRestrictions helps | 12 // Certain behavior is disallowed on certain threads. ThreadRestrictions helps |
13 // enforce these rules. Examples of such rules: | 13 // enforce these rules. Examples of such rules: |
14 // | 14 // |
15 // * Do not do blocking IO (makes the thread janky) | 15 // * Do not do blocking IO (makes the thread janky) |
16 // * Do not access Singleton/LazyInstance (may lead to shutdown crashes) | 16 // * Do not access Singleton/LazyInstance (may lead to shutdown crashes) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 static bool SetSingletonAllowed(bool allowed) { return true; } | 90 static bool SetSingletonAllowed(bool allowed) { return true; } |
91 static void AssertSingletonAllowed() {} | 91 static void AssertSingletonAllowed() {} |
92 #endif | 92 #endif |
93 | 93 |
94 private: | 94 private: |
95 DISALLOW_IMPLICIT_CONSTRUCTORS(ThreadRestrictions); | 95 DISALLOW_IMPLICIT_CONSTRUCTORS(ThreadRestrictions); |
96 }; | 96 }; |
97 | 97 |
98 } // namespace base | 98 } // namespace base |
99 | 99 |
100 #endif // BASE_THREAD_RESTRICTIONS_H_ | 100 #endif // BASE_THREADING_THREAD_RESTRICTIONS_H_ |
OLD | NEW |