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

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

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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/awakable_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_
6 #define MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_
7
8 #include <stdint.h>
9
10 #include <list>
11
12 #include "base/macros.h"
13 #include "mojo/edk/system/system_impl_export.h"
14 #include "mojo/public/c/system/types.h"
15
16 namespace mojo {
17 namespace system {
18
19 class Awakable;
20 struct HandleSignalsState;
21
22 // |AwakableList| tracks all the |Waiter|s that are waiting on a given
23 // handle/|Dispatcher|. There should be a |AwakableList| for each handle that
24 // can be waited on (in any way). In the simple case, the |AwakableList| is
25 // owned by the |Dispatcher|, whereas in more complex cases it is owned by the
26 // secondary object (see simple_dispatcher.* and the explanatory comment in
27 // core.cc). This class is thread-unsafe (all concurrent access must be
28 // protected by some lock).
29 class MOJO_SYSTEM_IMPL_EXPORT AwakableList {
30 public:
31 AwakableList();
32 ~AwakableList();
33
34 void AwakeForStateChange(const HandleSignalsState& state);
35 void CancelAll();
36 void Add(Awakable* awakable, MojoHandleSignals signals, uint32_t context);
37 void Remove(Awakable* awakable);
38
39 private:
40 struct AwakeInfo {
41 AwakeInfo(Awakable* awakable, MojoHandleSignals signals, uint32_t context)
42 : awakable(awakable), signals(signals), context(context) {}
43
44 Awakable* awakable;
45 MojoHandleSignals signals;
46 uint32_t context;
47 };
48 typedef std::list<AwakeInfo> AwakeInfoList;
49
50 AwakeInfoList awakables_;
51
52 DISALLOW_COPY_AND_ASSIGN(AwakableList);
53 };
54
55 } // namespace system
56 } // namespace mojo
57
58 #endif // MOJO_EDK_SYSTEM_AWAKABLE_LIST_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/awakable.h ('k') | mojo/edk/system/awakable_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698