| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 basic functions common to different Mojo system APIs. | 5 // This file contains basic functions common to different Mojo system APIs. |
| 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_FUNCTIONS_H_ | 9 #ifndef MOJO_PUBLIC_C_SYSTEM_FUNCTIONS_H_ |
| 10 #define MOJO_PUBLIC_C_SYSTEM_FUNCTIONS_H_ | 10 #define MOJO_PUBLIC_C_SYSTEM_FUNCTIONS_H_ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // Returns: | 39 // Returns: |
| 40 // |MOJO_RESULT_OK| on success. | 40 // |MOJO_RESULT_OK| on success. |
| 41 // |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle. | 41 // |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle. |
| 42 // | 42 // |
| 43 // Concurrent operations on |handle| may succeed (or fail as usual) if they | 43 // Concurrent operations on |handle| may succeed (or fail as usual) if they |
| 44 // happen before the close, be cancelled with result |MOJO_RESULT_CANCELLED| if | 44 // happen before the close, be cancelled with result |MOJO_RESULT_CANCELLED| if |
| 45 // they properly overlap (this is likely the case with |MojoWait()|, etc.), or | 45 // they properly overlap (this is likely the case with |MojoWait()|, etc.), or |
| 46 // fail with |MOJO_RESULT_INVALID_ARGUMENT| if they happen after. | 46 // fail with |MOJO_RESULT_INVALID_ARGUMENT| if they happen after. |
| 47 MOJO_SYSTEM_EXPORT MojoResult MojoClose(MojoHandle handle); | 47 MOJO_SYSTEM_EXPORT MojoResult MojoClose(MojoHandle handle); |
| 48 | 48 |
| 49 // Queries the last known signals state of a handle. |
| 50 // |
| 51 // Note that no guarantees can be made about the accuracy of the returned |
| 52 // signals state by the time this returns, as other threads in the system may |
| 53 // change the handle's state at any time. Use with appropriate discretion. |
| 54 // |
| 55 // Returns: |
| 56 // |MOJO_RESULT_OK| on success. |*signals_state| is populated with the |
| 57 // last known signals state of |handle|. |
| 58 // |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle or |
| 59 // |signals_state| is null. |
| 60 MOJO_SYSTEM_EXPORT MojoResult |
| 61 MojoQueryHandleSignalsState(MojoHandle handle, |
| 62 struct MojoHandleSignalsState* signals_state); |
| 63 |
| 49 // Waits on the given handle until one of the following happens: | 64 // Waits on the given handle until one of the following happens: |
| 50 // - A signal indicated by |signals| is satisfied. | 65 // - A signal indicated by |signals| is satisfied. |
| 51 // - It becomes known that no signal indicated by |signals| will ever be | 66 // - It becomes known that no signal indicated by |signals| will ever be |
| 52 // satisfied. (See the description of the |MOJO_RESULT_CANCELLED| and | 67 // satisfied. (See the description of the |MOJO_RESULT_CANCELLED| and |
| 53 // |MOJO_RESULT_FAILED_PRECONDITION| return values below.) | 68 // |MOJO_RESULT_FAILED_PRECONDITION| return values below.) |
| 54 // - Until |deadline| has passed. | 69 // - Until |deadline| has passed. |
| 55 // | 70 // |
| 56 // If |deadline| is |MOJO_DEADLINE_INDEFINITE|, this will wait "forever" (until | 71 // If |deadline| is |MOJO_DEADLINE_INDEFINITE|, this will wait "forever" (until |
| 57 // one of the other wait termination conditions is satisfied). If |deadline| is | 72 // one of the other wait termination conditions is satisfied). If |deadline| is |
| 58 // 0, this will return |MOJO_RESULT_DEADLINE_EXCEEDED| only if one of the other | 73 // 0, this will return |MOJO_RESULT_DEADLINE_EXCEEDED| only if one of the other |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // |MOJO_RESULT_INVALID_ARGUMENT| if |type| is not recognized. In this case, | 153 // |MOJO_RESULT_INVALID_ARGUMENT| if |type| is not recognized. In this case, |
| 139 // |value| is untouched. | 154 // |value| is untouched. |
| 140 MOJO_SYSTEM_EXPORT MojoResult MojoGetProperty(MojoPropertyType type, | 155 MOJO_SYSTEM_EXPORT MojoResult MojoGetProperty(MojoPropertyType type, |
| 141 void* value); | 156 void* value); |
| 142 | 157 |
| 143 #ifdef __cplusplus | 158 #ifdef __cplusplus |
| 144 } // extern "C" | 159 } // extern "C" |
| 145 #endif | 160 #endif |
| 146 | 161 |
| 147 #endif // MOJO_PUBLIC_C_SYSTEM_FUNCTIONS_H_ | 162 #endif // MOJO_PUBLIC_C_SYSTEM_FUNCTIONS_H_ |
| OLD | NEW |