Index: mojo/public/c/system/handle.h |
diff --git a/mojo/public/c/system/handle.h b/mojo/public/c/system/handle.h |
index 73a7ed814f2ad34155a524e80ec3975de293d216..2751886eaef75bb91a6c86dbe499fcd0f4fe941b 100644 |
--- a/mojo/public/c/system/handle.h |
+++ b/mojo/public/c/system/handle.h |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-// This file contains the handle-related definitions/declarations. |
+// This file contains Mojo system handle-related declarations/definitions. |
// |
// Note: This header should be compilable as C. |
@@ -12,6 +12,7 @@ |
#include <stdint.h> |
#include "mojo/public/c/system/macros.h" |
+#include "mojo/public/c/system/result.h" |
// |MojoHandle|: Handles to Mojo objects. |
// |MOJO_HANDLE_INVALID| - A value that is never a valid handle. |
@@ -54,4 +55,24 @@ struct MOJO_ALIGNAS(4) MojoHandleSignalsState { |
MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, |
"MojoHandleSignalsState has wrong size"); |
+#ifdef __cplusplus |
jamesr
2016/03/11 18:36:42
maybe this should go in macros.h - i forsee it bei
viettrungluu
2016/03/11 20:38:31
Will think about doing so (separately).
|
+extern "C" { |
+#endif |
+ |
+// Closes the given |handle|. |
+// |
+// Returns: |
+// |MOJO_RESULT_OK| on success. |
+// |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle. |
+// |
+// Concurrent operations on |handle| may succeed (or fail as usual) if they |
+// happen before the close, be cancelled with result |MOJO_RESULT_CANCELLED| if |
+// they properly overlap (this is likely the case with |MojoWait()|, etc.), or |
+// fail with |MOJO_RESULT_INVALID_ARGUMENT| if they happen after. |
+MojoResult MojoClose(MojoHandle handle); |
+ |
+#ifdef __cplusplus |
+} // extern "C" |
+#endif |
+ |
#endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ |