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

Side by Side Diff: mojo/edk/system/awakable_list.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/awakable.h ('k') | mojo/edk/system/channel.h » ('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_AWAKABLE_LIST_H_ 5 #ifndef MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_
6 #define MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_ 6 #define MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "mojo/edk/system/system_impl_export.h"
13 #include "mojo/public/c/system/types.h" 12 #include "mojo/public/c/system/types.h"
14 #include "mojo/public/cpp/system/macros.h" 13 #include "mojo/public/cpp/system/macros.h"
15 14
16 namespace mojo { 15 namespace mojo {
17 namespace system { 16 namespace system {
18 17
19 class Awakable; 18 class Awakable;
20 struct HandleSignalsState; 19 struct HandleSignalsState;
21 20
22 // |AwakableList| tracks all the |Waiter|s that are waiting on a given 21 // |AwakableList| tracks all the |Awakable|s (usually |Waiter|s) that are
23 // handle/|Dispatcher|. There should be a |AwakableList| for each handle that 22 // waiting on a given handle/|Dispatcher|. There should be a |AwakableList| for
24 // can be waited on (in any way). In the simple case, the |AwakableList| is 23 // each handle that can be waited on (in any way). In the simple case, the
25 // owned by the |Dispatcher|, whereas in more complex cases it is owned by the 24 // |AwakableList| is owned by the |Dispatcher|, whereas in more complex cases it
26 // secondary object (see simple_dispatcher.* and the explanatory comment in 25 // is owned by the secondary object (see simple_dispatcher.* and the explanatory
27 // core.cc). This class is thread-unsafe (all concurrent access must be 26 // comment in core.cc). This class is thread-unsafe (all concurrent access must
28 // protected by some lock). 27 // be protected by some lock).
29 class MOJO_SYSTEM_IMPL_EXPORT AwakableList { 28 class AwakableList {
30 public: 29 public:
31 AwakableList(); 30 AwakableList();
32 ~AwakableList(); 31 ~AwakableList();
33 32
34 void AwakeForStateChange(const HandleSignalsState& state); 33 void AwakeForStateChange(const HandleSignalsState& state);
35 void CancelAll(); 34 void CancelAll();
36 void Add(Awakable* awakable, MojoHandleSignals signals, uint32_t context); 35 void Add(Awakable* awakable, MojoHandleSignals signals, uint32_t context);
37 void Remove(Awakable* awakable); 36 void Remove(Awakable* awakable);
38 37
39 private: 38 private:
40 struct AwakeInfo { 39 struct AwakeInfo {
41 AwakeInfo(Awakable* awakable, MojoHandleSignals signals, uint32_t context) 40 AwakeInfo(Awakable* awakable, MojoHandleSignals signals, uint32_t context)
42 : awakable(awakable), signals(signals), context(context) {} 41 : awakable(awakable), signals(signals), context(context) {}
43 42
44 Awakable* awakable; 43 Awakable* awakable;
45 MojoHandleSignals signals; 44 MojoHandleSignals signals;
46 uint32_t context; 45 uint32_t context;
47 }; 46 };
48 using AwakeInfoList = std::vector<AwakeInfo>; 47 using AwakeInfoList = std::vector<AwakeInfo>;
49 48
50 AwakeInfoList awakables_; 49 AwakeInfoList awakables_;
51 50
52 MOJO_DISALLOW_COPY_AND_ASSIGN(AwakableList); 51 MOJO_DISALLOW_COPY_AND_ASSIGN(AwakableList);
53 }; 52 };
54 53
55 } // namespace system 54 } // namespace system
56 } // namespace mojo 55 } // namespace mojo
57 56
58 #endif // MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_ 57 #endif // MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/awakable.h ('k') | mojo/edk/system/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698