summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-03-18 23:36:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-03-18 23:36:49 (GMT)
commitf38864920d4e0bc8adaf9a23fd3f775ad90cb3f7 (patch)
treeb5f709e5415db2f1a9287b43565fea826b3018f5 /src/H5private.h
parent4a17aff4085ad6ee265b95730aca3f493056dec8 (diff)
parent7aa4eb1b04014f1ad7e1c857ca6509aeeb6c0ae7 (diff)
downloadhdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.zip
hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.gz
hdf5-f38864920d4e0bc8adaf9a23fd3f775ad90cb3f7.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_func_enter_vol
Plus initial steps toward merging API context push into FUNC_ENTER_API* macros
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/H5private.h b/src/H5private.h
index b68b886..6334f39 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1987,6 +1987,11 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
#define H5_PACKAGE_INIT(pkg_init, err)
#endif /* H5_MY_PKG */
+/* Forward declaration of H5CXpush() / H5CXpop() */
+/* (Including H5CXprivate.h creates bad circular dependencies - QAK, 3/18/2018) */
+H5_DLL herr_t H5CX_push(void);
+H5_DLL herr_t H5CX_pop(void);
+
#ifndef NDEBUG
#define FUNC_ENTER_CHECK_NAME(asrt) \
@@ -2026,7 +2031,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
/* Local variables for API routines */
#define FUNC_ENTER_API_VARS \
MPE_LOG_VARS \
- H5TRACE_DECL
+ H5TRACE_DECL \
#define FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_VARS \
@@ -2047,6 +2052,10 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
/* Push the name of this function on the function stack */ \
H5_PUSH_FUNC \
\
+ /* Push the API context */ \
+ if(H5CX_push() < 0) \
+ HGOTO_ERROR(H5E_FUNC, H5E_CANTSET, err, "can't set API context") \
+ \
BEGIN_MPE_LOG
/* Use this macro for all "normal" API functions */
@@ -2069,7 +2078,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
/*
* Use this macro for API functions that shouldn't perform _any_ initialization
* of the library or an interface, just perform tracing, etc. Examples
- * are: H5check_version, etc.
+ * are: H5allocate_memory, H5is_library_threadsafe, etc.
*
*/
#define FUNC_ENTER_API_NOINIT {{ \
@@ -2282,11 +2291,15 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
H5_API_UNLOCK \
H5_API_SET_CANCEL
-#define FUNC_LEAVE_API(ret_value) \
+#define FUNC_LEAVE_API_COMMON(ret_value) \
; \
} /*end scope from end of FUNC_ENTER*/ \
FINISH_MPE_LOG \
- H5TRACE_RETURN(ret_value); \
+ H5TRACE_RETURN(ret_value);
+
+#define FUNC_LEAVE_API(ret_value) \
+ FUNC_LEAVE_API_COMMON(ret_value); \
+ (void)H5CX_pop(); \
H5_POP_FUNC \
if(err_occurred) \
(void)H5E_dump_api_stack(TRUE); \
@@ -2294,12 +2307,19 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
return(ret_value); \
}} /*end scope from beginning of FUNC_ENTER*/
-/* Use this macro to match the FUNC_ENTER_API_NOFS macro */
+/* Use this macro to match the FUNC_ENTER_API_NOINIT macro */
+#define FUNC_LEAVE_API_NOINIT(ret_value) \
+ FUNC_LEAVE_API_COMMON(ret_value); \
+ H5_POP_FUNC \
+ if(err_occurred) \
+ (void)H5E_dump_api_stack(TRUE); \
+ FUNC_LEAVE_API_THREADSAFE \
+ return(ret_value); \
+}} /*end scope from beginning of FUNC_ENTER*/
+
+/* Use this macro to match the FUNC_ENTER_API_NOINIT_NOERR_NOFS macro */
#define FUNC_LEAVE_API_NOFS(ret_value) \
- ; \
- } /*end scope from end of FUNC_ENTER*/ \
- FINISH_MPE_LOG \
- H5TRACE_RETURN(ret_value); \
+ FUNC_LEAVE_API_COMMON(ret_value); \
FUNC_LEAVE_API_THREADSAFE \
return(ret_value); \
}} /*end scope from beginning of FUNC_ENTER*/