summaryrefslogtreecommitdiffstats
path: root/src/H5CS.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5CS.c')
-rw-r--r--src/H5CS.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/H5CS.c b/src/H5CS.c
index 38d9e1b..ed7f8b6 100644
--- a/src/H5CS.c
+++ b/src/H5CS.c
@@ -84,8 +84,16 @@ H5FS_get_stack(void)
if (!fstack) {
/* no associated value with current thread - create one */
fstack = (H5FS_t *)HDmalloc(sizeof(H5FS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */
- pthread_setspecific(H5TS_funcstk_key_g, (void *)fstack);
+ HDassert(fstack);
+
+ /* Set the thread-specific info */
fstack->nused=0;
+
+ /* (It's not necessary to release this in this API, it is
+ * released by the "key destructor" set up in the H5TS
+ * routines. See calls to pthread_key_create() in H5TS.c -QAK)
+ */
+ pthread_setspecific(H5TS_funcstk_key_g, (void *)fstack);
}
FUNC_LEAVE_NOAPI_NOFS(fstack);