OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MOJO_EDK_SYSTEM_WAITER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_WAITER_H_ |
6 #define MOJO_EDK_SYSTEM_WAITER_H_ | 6 #define MOJO_EDK_SYSTEM_WAITER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "mojo/edk/system/awakable.h" | 10 #include "mojo/edk/system/awakable.h" |
11 #include "mojo/edk/util/cond_var.h" | 11 #include "mojo/edk/util/cond_var.h" |
12 #include "mojo/edk/util/mutex.h" | 12 #include "mojo/edk/util/mutex.h" |
13 #include "mojo/edk/util/thread_annotations.h" | 13 #include "mojo/edk/util/thread_annotations.h" |
14 #include "mojo/public/c/system/result.h" | 14 #include "mojo/public/c/system/result.h" |
15 #include "mojo/public/c/system/types.h" | 15 #include "mojo/public/c/system/time.h" |
16 #include "mojo/public/cpp/system/macros.h" | 16 #include "mojo/public/cpp/system/macros.h" |
17 | 17 |
18 namespace mojo { | 18 namespace mojo { |
19 namespace system { | 19 namespace system { |
20 | 20 |
21 // IMPORTANT (all-caps gets your attention, right?): |Waiter| methods are called | 21 // IMPORTANT (all-caps gets your attention, right?): |Waiter| methods are called |
22 // under other locks, in particular, |Dispatcher::lock_|s, so |Waiter| methods | 22 // under other locks, in particular, |Dispatcher::lock_|s, so |Waiter| methods |
23 // must never call out to other objects (in particular, |Dispatcher|s). This | 23 // must never call out to other objects (in particular, |Dispatcher|s). This |
24 // class is thread-safe. | 24 // class is thread-safe. |
25 class Waiter final : public Awakable { | 25 class Waiter final : public Awakable { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 MojoResult awake_result_ MOJO_GUARDED_BY(mutex_); | 71 MojoResult awake_result_ MOJO_GUARDED_BY(mutex_); |
72 uintptr_t awake_context_ MOJO_GUARDED_BY(mutex_); | 72 uintptr_t awake_context_ MOJO_GUARDED_BY(mutex_); |
73 | 73 |
74 MOJO_DISALLOW_COPY_AND_ASSIGN(Waiter); | 74 MOJO_DISALLOW_COPY_AND_ASSIGN(Waiter); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace system | 77 } // namespace system |
78 } // namespace mojo | 78 } // namespace mojo |
79 | 79 |
80 #endif // MOJO_EDK_SYSTEM_WAITER_H_ | 80 #endif // MOJO_EDK_SYSTEM_WAITER_H_ |
OLD | NEW |