| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // This file contains functions for waiting on multiple handles using wait sets. | 5 // This file contains functions for waiting on multiple handles using wait sets. |
| 6 // | 6 // |
| 7 // Note: This header should be compilable as C. | 7 // Note: This header should be compilable as C. |
| 8 | 8 |
| 9 #ifndef MOJO_PUBLIC_C_SYSTEM_WAIT_SET_H_ | 9 #ifndef MOJO_PUBLIC_C_SYSTEM_WAIT_SET_H_ |
| 10 #define MOJO_PUBLIC_C_SYSTEM_WAIT_SET_H_ | 10 #define MOJO_PUBLIC_C_SYSTEM_WAIT_SET_H_ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // struct. (Used to allow for future extensions.) | 22 // struct. (Used to allow for future extensions.) |
| 23 // |MojoCreateWaitSetOptionsFlags flags|: Reserved for future use | 23 // |MojoCreateWaitSetOptionsFlags flags|: Reserved for future use |
| 24 // |MOJO_CREATE_WAIT_SET_OPTIONS_FLAGS_NONE|: No flags, default mode. | 24 // |MOJO_CREATE_WAIT_SET_OPTIONS_FLAGS_NONE|: No flags, default mode. |
| 25 | 25 |
| 26 typedef uint32_t MojoCreateWaitSetOptionsFlags; | 26 typedef uint32_t MojoCreateWaitSetOptionsFlags; |
| 27 | 27 |
| 28 struct MOJO_ALIGNAS(8) MojoCreateWaitSetOptions { | 28 struct MOJO_ALIGNAS(8) MojoCreateWaitSetOptions { |
| 29 uint32_t struct_size; | 29 uint32_t struct_size; |
| 30 MojoCreateWaitSetOptionsFlags flags; | 30 MojoCreateWaitSetOptionsFlags flags; |
| 31 }; | 31 }; |
| 32 MOJO_STATIC_ASSERT(sizeof(MojoCreateWaitSetOptions) == 8, | 32 MOJO_STATIC_ASSERT(sizeof(struct MojoCreateWaitSetOptions) == 8, |
| 33 "MojoCreateWaitSetOptions has wrong size"); | 33 "MojoCreateWaitSetOptions has wrong size"); |
| 34 | 34 |
| 35 // |MojoWaitSetAddOptions|: Used to specify parameters in adding an entry to a | 35 // |MojoWaitSetAddOptions|: Used to specify parameters in adding an entry to a |
| 36 // wait set with |MojoWaitSetAdd()|. | 36 // wait set with |MojoWaitSetAdd()|. |
| 37 // |uint32_t struct_size|: Set to the size of the |MojoWaitSetAddOptions| | 37 // |uint32_t struct_size|: Set to the size of the |MojoWaitSetAddOptions| |
| 38 // struct. (Used to allow for future extensions.) | 38 // struct. (Used to allow for future extensions.) |
| 39 // |MojoWaitSetAddOptionsFlags flags|: Reserved for future use. | 39 // |MojoWaitSetAddOptionsFlags flags|: Reserved for future use. |
| 40 // |MOJO_WAIT_SET_ADD_OPTIONS_FLAGS_NONE|: No flags, default mode. | 40 // |MOJO_WAIT_SET_ADD_OPTIONS_FLAGS_NONE|: No flags, default mode. |
| 41 | 41 |
| 42 typedef uint32_t MojoWaitSetAddOptionsFlags; | 42 typedef uint32_t MojoWaitSetAddOptionsFlags; |
| 43 | 43 |
| 44 #define MOJO_CREATE_WAIT_SET_OPTIONS_FLAG_NONE \ | 44 #define MOJO_CREATE_WAIT_SET_OPTIONS_FLAG_NONE \ |
| 45 ((MojoCreateWaitSetOptionsFlags)0) | 45 ((MojoCreateWaitSetOptionsFlags)0) |
| 46 | 46 |
| 47 struct MOJO_ALIGNAS(8) MojoWaitSetAddOptions { | 47 struct MOJO_ALIGNAS(8) MojoWaitSetAddOptions { |
| 48 uint32_t struct_size; | 48 uint32_t struct_size; |
| 49 MojoWaitSetAddOptionsFlags flags; | 49 MojoWaitSetAddOptionsFlags flags; |
| 50 }; | 50 }; |
| 51 MOJO_STATIC_ASSERT(sizeof(MojoWaitSetAddOptions) == 8, | 51 MOJO_STATIC_ASSERT(sizeof(struct MojoWaitSetAddOptions) == 8, |
| 52 "MojoWaitSetAddOptions has wrong size"); | 52 "MojoWaitSetAddOptions has wrong size"); |
| 53 | 53 |
| 54 // |MojoWaitSetResult|: Returned by |MojoWaitSetWait()| to indicate the state of | 54 // |MojoWaitSetResult|: Returned by |MojoWaitSetWait()| to indicate the state of |
| 55 // entries. See |MojoWaitSetWait()| for the values of these fields. | 55 // entries. See |MojoWaitSetWait()| for the values of these fields. |
| 56 | 56 |
| 57 struct MOJO_ALIGNAS(8) MojoWaitSetResult { | 57 struct MOJO_ALIGNAS(8) MojoWaitSetResult { |
| 58 uint64_t cookie; | 58 uint64_t cookie; |
| 59 MojoResult wait_result; | 59 MojoResult wait_result; |
| 60 uint32_t reserved; | 60 uint32_t reserved; |
| 61 MojoHandleSignals satisfied_signals; | 61 MojoHandleSignals satisfied_signals; |
| 62 MojoHandleSignals satisfiable_signals; | 62 MojoHandleSignals satisfiable_signals; |
| 63 }; | 63 }; |
| 64 MOJO_STATIC_ASSERT(sizeof(MojoWaitSetResult) == 24, | 64 MOJO_STATIC_ASSERT(sizeof(struct MojoWaitSetResult) == 24, |
| 65 "MojoWaitSetResult has wrong size"); | 65 "MojoWaitSetResult has wrong size"); |
| 66 | 66 |
| 67 MOJO_BEGIN_EXTERN_C | 67 MOJO_BEGIN_EXTERN_C |
| 68 | 68 |
| 69 // |MojoCreateWaitSet()|: Creates a new wait set. | 69 // |MojoCreateWaitSet()|: Creates a new wait set. |
| 70 // | 70 // |
| 71 // A wait set is an object that can be used to wait for a set of handles to | 71 // A wait set is an object that can be used to wait for a set of handles to |
| 72 // satisfy some set of signals simultaneously. | 72 // satisfy some set of signals simultaneously. |
| 73 // | 73 // |
| 74 // If |options| is null, the default options will be used. | 74 // If |options| is null, the default options will be used. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 MojoResult MojoWaitSetWait( | 177 MojoResult MojoWaitSetWait( |
| 178 MojoHandle wait_set_handle, // In. | 178 MojoHandle wait_set_handle, // In. |
| 179 MojoDeadline deadline, // In. | 179 MojoDeadline deadline, // In. |
| 180 uint32_t* MOJO_RESTRICT num_results, // In/out. | 180 uint32_t* MOJO_RESTRICT num_results, // In/out. |
| 181 struct MojoWaitSetResult* MOJO_RESTRICT results, // Out. | 181 struct MojoWaitSetResult* MOJO_RESTRICT results, // Out. |
| 182 uint32_t* MOJO_RESTRICT max_results); // Optional out. | 182 uint32_t* MOJO_RESTRICT max_results); // Optional out. |
| 183 | 183 |
| 184 MOJO_END_EXTERN_C | 184 MOJO_END_EXTERN_C |
| 185 | 185 |
| 186 #endif // MOJO_PUBLIC_C_SYSTEM_WAIT_SET_H_ | 186 #endif // MOJO_PUBLIC_C_SYSTEM_WAIT_SET_H_ |
| OLD | NEW |