diff options
author | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2018-05-08 22:17:45 (GMT) |
---|---|---|
committer | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2018-05-08 22:17:45 (GMT) |
commit | b69bd0771eba5810db3db25217d5f32dc479185e (patch) | |
tree | c783a54f7cd8ef2ff504299749f5e18486a0363d /src/H5.c | |
parent | 525b9f40e5c112b777a28d207ccb6fd454f156fc (diff) | |
parent | 0cc480d952e2e215f006fc172485fcbabc0f599f (diff) | |
download | hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.zip hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.tar.gz hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.tar.bz2 |
Merge branch 'develop' into hdf5_1_10.sync
Diffstat (limited to 'src/H5.c')
-rw-r--r-- | src/H5.c | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -21,6 +21,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ @@ -30,7 +31,6 @@ #include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip lists */ #include "H5Tprivate.h" /* Datatypes */ -#include "H5FSprivate.h" /* File free space */ /****************/ /* Local Macros */ @@ -224,7 +224,7 @@ H5_init_library(void) if(H5L_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize link interface") if(H5FS_init() < 0) - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize FS interface") + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize FS interface") /* Debugging? */ H5_debug_mask("-all"); @@ -267,6 +267,9 @@ H5_term_library(void) /* Indicate that the library is being shut down */ H5_TERM_GLOBAL = TRUE; + /* Push the API context without checking for errors */ + H5CX_push_special(); + /* Check if we should display error output */ (void)H5Eget_auto2(H5E_DEFAULT, &func, NULL); @@ -351,9 +354,12 @@ H5_term_library(void) /* Don't shut down the skip list code until everything that uses it is down */ if(pending == 0) pending += DOWN(SL); - /* Don't shut down the free list code until _everything_ else is down */ + /* Don't shut down the free list code until everything that uses it is down */ if(pending == 0) pending += DOWN(FL); + /* Don't shut down the API context code until _everything_ else is down */ + if(pending == 0) + pending += DOWN(CX); } /* end if */ } while(pending && ntries++ < 100); @@ -409,6 +415,8 @@ H5_term_library(void) /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; + /* Don't pop the API context (i.e. H5CX_pop), since it's been shut down already */ + done: #ifdef H5_HAVE_THREADSAFE H5_API_UNLOCK @@ -907,7 +915,7 @@ H5allocate_memory(size_t size, hbool_t clear) else ret_value = H5MM_malloc(size); - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_API_NOINIT(ret_value) } /* end H5allocate_memory() */ @@ -945,7 +953,7 @@ H5resize_memory(void *mem, size_t size) ret_value = H5MM_realloc(mem, size); - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_API_NOINIT(ret_value) } /* end H5resize_memory() */ @@ -970,7 +978,7 @@ H5free_memory(void *mem) /* At this time, it is impossible for this to fail. */ H5MM_xfree(mem); - FUNC_LEAVE_API(SUCCEED) + FUNC_LEAVE_API_NOINIT(SUCCEED) } /* end H5free_memory() */ @@ -987,20 +995,19 @@ H5free_memory(void *mem) herr_t H5is_library_threadsafe(hbool_t *is_ts) { - herr_t ret_value = SUCCEED; - FUNC_ENTER_API_NOINIT H5TRACE1("e", "*b", is_ts); HDassert(is_ts); + /* At this time, it is impossible for this to fail. */ #ifdef H5_HAVE_THREADSAFE *is_ts = TRUE; #else /* H5_HAVE_THREADSAFE */ *is_ts = FALSE; #endif /* H5_HAVE_THREADSAFE */ - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_API_NOINIT(SUCCEED) } /* end H5is_library_threadsafe() */ |