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 handles (directly). | 5 // This file contains functions for waiting on handles (directly). |
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_H_ | 9 #ifndef MOJO_PUBLIC_C_SYSTEM_WAIT_H_ |
10 #define MOJO_PUBLIC_C_SYSTEM_WAIT_H_ | 10 #define MOJO_PUBLIC_C_SYSTEM_WAIT_H_ |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // - It becomes known that no signal in some |signals[i]| will ever be | 64 // - It becomes known that no signal in some |signals[i]| will ever be |
65 // satisfied. | 65 // satisfied. |
66 // - |deadline| has passed. | 66 // - |deadline| has passed. |
67 // | 67 // |
68 // This means that |MojoWaitMany()| behaves as if |MojoWait()| were called on | 68 // This means that |MojoWaitMany()| behaves as if |MojoWait()| were called on |
69 // each handle/signals pair simultaneously, completing when the first | 69 // each handle/signals pair simultaneously, completing when the first |
70 // |MojoWait()| would complete. | 70 // |MojoWait()| would complete. |
71 // | 71 // |
72 // See |MojoWait()| for more details about |deadline|. | 72 // See |MojoWait()| for more details about |deadline|. |
73 // | 73 // |
| 74 // Note that if |num_handles| is 0, this will wait until |deadline| has passed |
| 75 // (possibly forever if it is |MOJO_DEADLINE_INDEFINITE|), and handles|, |
| 76 // |signals|, |result_index|, and |signals_states| will all be ignored (so they |
| 77 // may be null or invalid pointers). |
| 78 // |
74 // |result_index| (optional) is used to return the index of the handle that | 79 // |result_index| (optional) is used to return the index of the handle that |
75 // caused the call to return. For example, the index |i| (from 0 to | 80 // caused the call to return. For example, the index |i| (from 0 to |
76 // |num_handles-1|) if |handle[i]| satisfies a signal from |signals[i]|. You | 81 // |num_handles-1|) if |handle[i]| satisfies a signal from |signals[i]|. You |
77 // must manually initialize this to a suitable sentinel value (e.g. -1) | 82 // must manually initialize this to a suitable sentinel value (e.g. -1) |
78 // before you make this call because this value is not updated if there is | 83 // before you make this call because this value is not updated if there is |
79 // no specific handle that causes the function to return. Pass null if you | 84 // no specific handle that causes the function to return. Pass null if you |
80 // don't need this value to be returned. | 85 // don't need this value to be returned. |
81 // | 86 // |
82 // |signals_states| (optional) points to an array of size |num_handles| of | 87 // |signals_states| (optional) points to an array of size |num_handles| of |
83 // MojoHandleSignalsState. See |MojoHandleSignalsState| for more details | 88 // MojoHandleSignalsState. See |MojoHandleSignalsState| for more details |
(...skipping 22 matching lines...) Expand all Loading... |
106 const MojoHandleSignals* MOJO_RESTRICT signals, // In. | 111 const MojoHandleSignals* MOJO_RESTRICT signals, // In. |
107 uint32_t num_handles, // In. | 112 uint32_t num_handles, // In. |
108 MojoDeadline deadline, // In. | 113 MojoDeadline deadline, // In. |
109 uint32_t* MOJO_RESTRICT result_index, // Optional out. | 114 uint32_t* MOJO_RESTRICT result_index, // Optional out. |
110 struct MojoHandleSignalsState* MOJO_RESTRICT | 115 struct MojoHandleSignalsState* MOJO_RESTRICT |
111 signals_states); // Optional out. | 116 signals_states); // Optional out. |
112 | 117 |
113 MOJO_END_EXTERN_C | 118 MOJO_END_EXTERN_C |
114 | 119 |
115 #endif // MOJO_PUBLIC_C_SYSTEM_WAIT_H_ | 120 #endif // MOJO_PUBLIC_C_SYSTEM_WAIT_H_ |
OLD | NEW |