summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2018-04-19 03:53:18 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2018-04-19 03:53:18 (GMT)
commitfa829e322ed44a67e2b3f2d6adf1306ad794859b (patch)
tree13d46d6f1bb59215acdcd8072338010c0c84d6df /src
parente217bd113db96b96b485de82395688ca2313918a (diff)
parent76cab1f5cb48af8398e1c09c15a974b1f8347da4 (diff)
downloadhdf5-fa829e322ed44a67e2b3f2d6adf1306ad794859b.zip
hdf5-fa829e322ed44a67e2b3f2d6adf1306ad794859b.tar.gz
hdf5-fa829e322ed44a67e2b3f2d6adf1306ad794859b.tar.bz2
Merge pull request #1035 in HDFFV/hdf5 from fix_api_context_filter_plugin to develop
* commit '76cab1f5cb48af8398e1c09c15a974b1f8347da4': 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 */