diff options
Diffstat (limited to 'src/H5FS.c')
-rw-r--r-- | src/H5FS.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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); |