summaryrefslogtreecommitdiffstats
path: root/mojo/public/c/system/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'mojo/public/c/system/types.h')
-rw-r--r--mojo/public/c/system/types.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/mojo/public/c/system/types.h b/mojo/public/c/system/types.h
index 4574d74..6d21b12 100644
--- a/mojo/public/c/system/types.h
+++ b/mojo/public/c/system/types.h
@@ -182,4 +182,24 @@ struct MOJO_ALIGNAS(4) MojoHandleSignalsState {
MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8,
"MojoHandleSignalsState has wrong size");
+// |MojoWatchNotificationFlags|: Passed to a callback invoked as a result of
+// signals being raised on a handle watched by |MojoWatch()|. May take the
+// following values:
+// |MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM| - The callback is being invoked
+// as a result of a system-level event rather than a direct API call from
+// user code. This may be used as an indication that user code is safe to
+// call without fear of reentry.
+
+typedef uint32_t MojoWatchNotificationFlags;
+
+#ifdef __cplusplus
+const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_NONE = 0;
+const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM =
+ 1 << 0;
+#else
+#define MOJO_WATCH_NOTIFICATION_FLAG_NONE ((MojoWatchNotificationFlags)0)
+#define MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM \
+ ((MojoWatchNotificationFlags)1 << 0);
+#endif
+
#endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_