summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-04-23 12:51:55 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-04-23 12:51:55 (GMT)
commitf435ed67fa53ca35462a60f4025464465d7dc9d0 (patch)
tree84cc1f217108c4585586ffd6e74782cbe91734ed /src
parent6c82c49dd5e5ee187ab1da9f54311a1ecab45bb8 (diff)
parentfa829e322ed44a67e2b3f2d6adf1306ad794859b (diff)
downloadhdf5-f435ed67fa53ca35462a60f4025464465d7dc9d0.zip
hdf5-f435ed67fa53ca35462a60f4025464465d7dc9d0.tar.gz
hdf5-f435ed67fa53ca35462a60f4025464465d7dc9d0.tar.bz2
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit 'fa829e322ed44a67e2b3f2d6adf1306ad794859b': Fix non-threadsafe API context head pointer handling.
Diffstat (limited to 'src')
-rw-r--r--src/H5CX.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/H5CX.c b/src/H5CX.c
index c81a0f4..deaf1a1 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -61,7 +61,7 @@
/*
* The current API context.
*/
-#define H5CX_get_my_context() (H5CX_head_g)
+#define H5CX_get_my_context() (&H5CX_head_g)
#endif /* H5_HAVE_THREADSAFE */
/* Common macro for the duplicated code to retrieve properties from a property list */
@@ -358,7 +358,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
/*******************/
#ifndef H5_HAVE_THREADSAFE
-static H5CX_node_t **H5CX_head_g = NULL; /* Pointer to head of context stack */
+static H5CX_node_t *H5CX_head_g = NULL; /* Pointer to head of context stack */
#endif /* H5_HAVE_THREADSAFE */
/* Define a "default" dataset transfer property list cache structure to use for default DXPLs */
@@ -391,13 +391,6 @@ H5CX__init_package(void)
FUNC_ENTER_STATIC
-#ifndef H5_HAVE_THREADSAFE
- /* Allocate the context stack head pointer */
- if(NULL == (H5CX_head_g = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *))))
- HGOTO_ERROR(H5E_CONTEXT, H5E_CANTALLOC, FAIL, "can't allocate pointer to head of context stack")
- *H5CX_head_g = NULL;
-#endif /* H5_HAVE_THREADSAFE */
-
/* Reset the "default DXPL cache" information */
HDmemset(&H5CX_def_dxpl_cache, 0, sizeof(H5CX_dxpl_cache_t));
@@ -546,8 +539,6 @@ H5CX_term_package(void)
HDfree(cnode);
#ifndef H5_HAVE_THREADSAFE
- /* Release pointer to head of API context stack */
- HDfree(H5CX_head_g);
H5CX_head_g = NULL;
#endif /* H5_HAVE_THREADSAFE */