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

Unified Diff: mojo/public/c/system/handle.h

Issue 1783623005: Add mojo/c/system/{time.h,wait.h}. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/c/system/functions.h ('k') | mojo/public/c/system/tests/core_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « mojo/public/c/system/functions.h ('k') | mojo/public/c/system/tests/core_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698