summaryrefslogtreecommitdiffstats
path: root/src/H5CS.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-11-16 01:01:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-11-16 01:01:37 (GMT)
commit671187fd2b53c916f444e849a2fd57bac06552f8 (patch)
treea1a723b81dda3c967a597a9d7477806e4fcfa706 /src/H5CS.c
parente70783203ab603627147c565d0fe08ddbe103981 (diff)
downloadhdf5-671187fd2b53c916f444e849a2fd57bac06552f8.zip
hdf5-671187fd2b53c916f444e849a2fd57bac06552f8.tar.gz
hdf5-671187fd2b53c916f444e849a2fd57bac06552f8.tar.bz2
[svn-r11733] Purpose:
Code cleanup Description: Added some comments about the thread-specific memory for the error and function stacks. Changed H5close() to not use the function stack (since it causes it to be re-enabled after shutting it down) Changed thread-safe semaphore code to not use dynamicly allocated memory. Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4 Too minor to require h5committest
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);