summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-11-16 20:10:25 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-11-16 20:10:25 (GMT)
commit62d822640607fd9b2bfe79da6bd0dafc36a4ad29 (patch)
tree95faf5127de0ba17bdadfbd563d94752d3142a17 /src/H5private.h
parent0593d9331414beabdd0d97b3a1e4d4d841b5309f (diff)
downloadhdf5-62d822640607fd9b2bfe79da6bd0dafc36a4ad29.zip
hdf5-62d822640607fd9b2bfe79da6bd0dafc36a4ad29.tar.gz
hdf5-62d822640607fd9b2bfe79da6bd0dafc36a4ad29.tar.bz2
[svn-r2951] Purpose:
Bug fix Description: Previous re-arrangement of FUNC_ENTER macro was a _little_ too agressive about not re-checking for library or interface re-initialization. Although it happens very rarely that the library is shut down and then re-started the library & interface initialization functions weren't getting run in that case. Solution: Separated out the library, interface & function checks again. This version is still a little faster than the previous way things were being done. Platforms tested: FreeBSD 4.1.1 (hawkwind)
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h51
1 files changed, 25 insertions, 26 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 3a30680..93f0f9e 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -949,37 +949,36 @@ extern hbool_t H5_libinit_g; /*good thing C's lazy about extern! */
\
PABLO_TRACE_ON (PABLO_MASK, pablo_func_id); \
\
+ /* Initialize the library */ \
+ H5_FIRST_THREAD_INIT \
+ H5_API_UNSET_CANCEL \
+ H5_API_LOCK_BEGIN \
+ if (!(H5_INIT_GLOBAL)) { \
+ H5_INIT_GLOBAL = TRUE; \
+ if (H5_init_library()<0) { \
+ HRETURN_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
+ "library initialization failed"); \
+ } \
+ } \
+ H5_API_LOCK_END \
+ \
+ /* Initialize this interface or bust */ \
+ if (!interface_initialize_g) { \
+ interface_initialize_g = 1; \
+ if (interface_init_func && \
+ ((herr_t(*)(void))interface_init_func)()<0) { \
+ interface_initialize_g = 0; \
+ HRETURN_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
+ "interface initialization failed"); \
+ } \
+ } \
+ \
/* Check if we know this is an API function or not */ \
- /* (Also useful for wrapping the global and library checks) */ \
if(!know_api) { \
know_api=1; \
is_api=H5_IS_API(FUNC); \
- \
- /* Initialize the library */ \
- H5_FIRST_THREAD_INIT \
- H5_API_UNSET_CANCEL \
- H5_API_LOCK_BEGIN \
- if (!(H5_INIT_GLOBAL)) { \
- H5_INIT_GLOBAL = TRUE; \
- if (H5_init_library()<0) { \
- HRETURN_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
- "library initialization failed"); \
- } \
- } \
- H5_API_LOCK_END \
- \
- /* Initialize this interface or bust */ \
- if (!interface_initialize_g) { \
- interface_initialize_g = 1; \
- if (interface_init_func && \
- ((herr_t(*)(void))interface_init_func)()<0) { \
- interface_initialize_g = 0; \
- HRETURN_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
- "interface initialization failed"); \
- } \
- } \
} \
- \
+ \
/* Clear thread error stack entering public functions */ \
if (is_api && H5E_clearable_g) { \
H5E_clear (); \