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

Side by Side Diff: mojo/edk/system/waiter.h

Issue 1346383004: EDK: Remove MOJO_SYSTEM_IMPL_EXPORT, system_impl_export.h, etc. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « mojo/edk/system/unique_identifier.h ('k') | mojo/edk/util/BUILD.gn » ('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 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 "base/synchronization/condition_variable.h" 10 #include "base/synchronization/condition_variable.h"
11 #include "base/synchronization/lock.h" 11 #include "base/synchronization/lock.h"
12 #include "mojo/edk/system/awakable.h" 12 #include "mojo/edk/system/awakable.h"
13 #include "mojo/edk/system/system_impl_export.h"
14 #include "mojo/public/c/system/types.h" 13 #include "mojo/public/c/system/types.h"
15 #include "mojo/public/cpp/system/macros.h" 14 #include "mojo/public/cpp/system/macros.h"
16 15
17 namespace mojo { 16 namespace mojo {
18 namespace system { 17 namespace system {
19 18
20 // IMPORTANT (all-caps gets your attention, right?): |Waiter| methods are called 19 // IMPORTANT (all-caps gets your attention, right?): |Waiter| methods are called
21 // under other locks, in particular, |Dispatcher::lock_|s, so |Waiter| methods 20 // under other locks, in particular, |Dispatcher::lock_|s, so |Waiter| methods
22 // must never call out to other objects (in particular, |Dispatcher|s). This 21 // must never call out to other objects (in particular, |Dispatcher|s). This
23 // class is thread-safe. 22 // class is thread-safe.
24 class MOJO_SYSTEM_IMPL_EXPORT Waiter final : public Awakable { 23 class Waiter final : public Awakable {
25 public: 24 public:
26 Waiter(); 25 Waiter();
27 ~Waiter(); 26 ~Waiter() override;
28 27
29 // A |Waiter| can be used multiple times; |Init()| should be called before 28 // A |Waiter| can be used multiple times; |Init()| should be called before
30 // each time it's used. 29 // each time it's used.
31 void Init(); 30 void Init();
32 31
33 // Waits until a suitable |Awake()| is called. (|context| may be null, in 32 // Waits until a suitable |Awake()| is called. (|context| may be null, in
34 // which case, obviously no context is ever returned.) 33 // which case, obviously no context is ever returned.)
35 // Returns: 34 // Returns:
36 // - The result given to the first call to |Awake()| (possibly before this 35 // - The result given to the first call to |Awake()| (possibly before this
37 // call to |Wait()|); in this case, |*context| is set to the value passed 36 // call to |Wait()|); in this case, |*context| is set to the value passed
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 MojoResult awake_result_; 69 MojoResult awake_result_;
71 uintptr_t awake_context_; 70 uintptr_t awake_context_;
72 71
73 MOJO_DISALLOW_COPY_AND_ASSIGN(Waiter); 72 MOJO_DISALLOW_COPY_AND_ASSIGN(Waiter);
74 }; 73 };
75 74
76 } // namespace system 75 } // namespace system
77 } // namespace mojo 76 } // namespace mojo
78 77
79 #endif // MOJO_EDK_SYSTEM_WAITER_H_ 78 #endif // MOJO_EDK_SYSTEM_WAITER_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/unique_identifier.h ('k') | mojo/edk/util/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698