summaryrefslogtreecommitdiffstats
path: root/src/H5TS.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-07-26 02:55:47 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-07-26 02:55:47 (GMT)
commit0d22a663df367ada055cb3695186c669e1dd6d5e (patch)
tree9a3c6588411b63b90ec5d86f65032c0f373eb4e2 /src/H5TS.c
parentb4b2b55d33be1c4f1c33aaf58294281a93b7da39 (diff)
downloadhdf5-0d22a663df367ada055cb3695186c669e1dd6d5e.zip
hdf5-0d22a663df367ada055cb3695186c669e1dd6d5e.tar.gz
hdf5-0d22a663df367ada055cb3695186c669e1dd6d5e.tar.bz2
[svn-r7265] *** empty log message ***
Diffstat (limited to 'src/H5TS.c')
-rw-r--r--src/H5TS.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/H5TS.c b/src/H5TS.c
index e57c5e6..9baec76 100644
--- a/src/H5TS.c
+++ b/src/H5TS.c
@@ -32,9 +32,6 @@ typedef struct H5TS_cancel_struct {
/* Global variable definitions */
pthread_once_t H5TS_first_init_g = PTHREAD_ONCE_INIT;
pthread_key_t H5TS_errstk_key_g;
-#ifndef NEW_ERR
-pthread_key_t H5TS_errstk_key_g_new;
-#endif /* NEW_ERR */
pthread_key_t H5TS_funcstk_key_g;
pthread_key_t H5TS_cancel_key_g;
hbool_t H5TS_allow_concurrent_g = FALSE; /* concurrent APIs override this */
@@ -108,17 +105,12 @@ H5TS_first_thread_init(void)
pthread_cond_init(&H5_g.init_lock.cond_var, NULL);
H5_g.init_lock.lock_count = 0;
- /* initialize key for thread-specific error stacks */
- pthread_key_create(&H5TS_errstk_key_g, H5TS_key_destructor);
-#ifndef NEW_ERR
- /* initialize key for thread-specific error stacks */
- pthread_key_create(&H5TS_errstk_key_g_new, H5TS_key_destructor);
-#endif /* NEW_ERR */
/* initialize key for thread-specific function stacks */
pthread_key_create(&H5TS_funcstk_key_g, H5TS_key_destructor);
-
/* initialize key for thread cancellability mechanism */
pthread_key_create(&H5TS_cancel_key_g, H5TS_key_destructor);
+ /* initialize key for thread-specific error stacks */
+ pthread_key_create(&H5TS_errstk_key_g, H5TS_key_destructor);
}
/*--------------------------------------------------------------------------
@@ -164,8 +156,8 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex)
mutex->owner_thread = H5MM_malloc(sizeof(pthread_t));
if (!mutex->owner_thread) {
- H5E_push(H5E_RESOURCE, H5E_NOSPACE, "H5TS_mutex_lock",
- __FILE__, __LINE__, "memory allocation failed");
+ H5E_push(H5E_get_my_stack(), "H5TS_mutex_lock", __FILE__, __LINE__,
+ H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed");
return FAIL;
}
@@ -180,8 +172,8 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex)
mutex->owner_thread = H5MM_malloc(sizeof(pthread_t));
if (!mutex->owner_thread) {
- H5E_push(H5E_RESOURCE, H5E_NOSPACE, "H5TS_mutex_lock",
- __FILE__, __LINE__, "memory allocation failed");
+ H5E_push(H5E_get_my_stack(), "H5TS_mutex_lock",
+ __FILE__, __LINE__, H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed");
return FAIL;
}
@@ -290,11 +282,12 @@ H5TS_cancel_count_inc(void)
* First time thread calls library - create new counter and associate
* with key
*/
- cancel_counter = H5MM_malloc(sizeof(H5TS_cancel_t));
+ /* Where is it freed? */
+ cancel_counter = H5MM_calloc(sizeof(H5TS_cancel_t));
if (!cancel_counter) {
- H5E_push(H5E_RESOURCE, H5E_NOSPACE, "H5TS_cancel_count_inc",
- __FILE__, __LINE__, "memory allocation failed");
+ H5E_push(H5E_get_my_stack(), "H5TS_cancel_count_inc",
+ __FILE__, __LINE__, H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed");
return FAIL;
}