summaryrefslogtreecommitdiffstats
path: root/src/H5CX.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5CX.c')
-rw-r--r--src/H5CX.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/H5CX.c b/src/H5CX.c
index c46c58a..0c6c873 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -760,6 +760,28 @@ H5CX__get_context(void)
#endif /* H5_HAVE_THREADSAFE */
/*-------------------------------------------------------------------------
+ * Function: H5CX_pushed
+ *
+ * Purpose: Returns whether or not an API context has been pushed.
+ *
+ * Return: true/false
+ *
+ *-------------------------------------------------------------------------
+ */
+bool
+H5CX_pushed(void)
+{
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+
+ FUNC_ENTER_NOAPI_NOERR
+
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ assert(head);
+
+ FUNC_LEAVE_NOAPI(*head != NULL);
+}
+
+/*-------------------------------------------------------------------------
* Function: H5CX__push_common
*
* Purpose: Internal routine to push a context for an API call.