Skip to content

Commit

Permalink
Rename routines for acquiring & releasing API mutex
Browse files Browse the repository at this point in the history
Signed-off-by: Quincey Koziol <[email protected]>
  • Loading branch information
qkoziol committed Jul 5, 2024
1 parent 218f662 commit 8ced6e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/H5TS.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ H5TSmutex_acquire(unsigned lock_count, bool *acquired)
FUNC_ENTER_API_NAMECHECK_ONLY

/* Acquire the "API" lock */
if (H5_UNLIKELY(H5TS__mutex_acquire(lock_count, acquired) < 0))
if (H5_UNLIKELY(H5TS__api_mutex_acquire(lock_count, acquired) < 0))
HGOTO_DONE(FAIL);

done:
Expand Down Expand Up @@ -133,7 +133,7 @@ H5TSmutex_release(unsigned *lock_count)

/* Release the "API" lock */
*lock_count = 0;
if (H5_UNLIKELY(H5TS__mutex_release(lock_count) < 0))
if (H5_UNLIKELY(H5TS__api_mutex_release(lock_count) < 0))
ret_value = FAIL;

FUNC_LEAVE_API_NAMECHECK_ONLY(ret_value)
Expand Down
15 changes: 8 additions & 7 deletions src/H5TSint.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ H5TS_term_package(void)
} /* end H5TS_term_package() */

/*--------------------------------------------------------------------------
* Function: H5TS__mutex_acquire
* Function: H5TS__api_mutex_acquire
*
* Purpose: Attempts to acquire the API lock, without blocking
*
Expand All @@ -170,7 +170,7 @@ H5TS_term_package(void)
*--------------------------------------------------------------------------
*/
herr_t
H5TS__mutex_acquire(unsigned lock_count, bool *acquired)
H5TS__api_mutex_acquire(unsigned lock_count, bool *acquired)
{
herr_t ret_value = SUCCEED;

Expand All @@ -190,7 +190,7 @@ H5TS__mutex_acquire(unsigned lock_count, bool *acquired)

done:
FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value)
} /* end H5TS__mutex_acquire() */
} /* end H5TS__api_mutex_acquire() */

/*--------------------------------------------------------------------------
* Function: H5TS_api_lock
Expand Down Expand Up @@ -234,7 +234,7 @@ H5TS_api_lock(void)
} /* end H5TS_api_lock() */

/*--------------------------------------------------------------------------
* Function: H5TS__mutex_release
* Function: H5TS__api_mutex_release
*
* Purpose: Release the global "API" lock for accessing the HDF5 library.
* Passes back the previous lock count to the caller in a
Expand All @@ -245,7 +245,7 @@ H5TS_api_lock(void)
*--------------------------------------------------------------------------
*/
herr_t
H5TS__mutex_release(unsigned *lock_count)
H5TS__api_mutex_release(unsigned *lock_count)
{
herr_t ret_value = SUCCEED;

Expand All @@ -264,7 +264,7 @@ H5TS__mutex_release(unsigned *lock_count)

done:
FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value)
} /* H5TS__mutex_release */
} /* H5TS__api_mutex_release */

/*--------------------------------------------------------------------------
* Function: H5TS_api_unlock
Expand Down Expand Up @@ -312,7 +312,8 @@ H5TS__tinfo_init(void)
FUNC_ENTER_PACKAGE_NAMECHECK_ONLY

/* Initialize the critical section for modifying the thread info globals */
H5TS_mutex_init(&H5TS_tinfo_mtx_s, H5TS_MUTEX_TYPE_PLAIN);
if (H5_UNLIKELY(H5TS_mutex_init(&H5TS_tinfo_mtx_s, H5TS_MUTEX_TYPE_PLAIN)) < 0)
ret_value = FAIL;

/* Initialize key for thread-specific API contexts */
#ifdef H5_HAVE_WIN_THREADS
Expand Down
4 changes: 2 additions & 2 deletions src/H5TSpkg.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ extern H5TS_key_t H5TS_thrd_info_key_g;
/******************************/
#ifdef H5_HAVE_THREADSAFE
H5_DLL herr_t H5TS__init(void);
H5_DLL herr_t H5TS__mutex_acquire(unsigned lock_count, bool *acquired);
H5_DLL herr_t H5TS__mutex_release(unsigned *lock_count);
H5_DLL herr_t H5TS__api_mutex_acquire(unsigned lock_count, bool *acquired);
H5_DLL herr_t H5TS__api_mutex_release(unsigned *lock_count);
H5_DLL herr_t H5TS__tinfo_init(void);
H5_DLL void H5TS__tinfo_destroy(void *tinfo_node);
H5_DLL herr_t H5TS__tinfo_term(void);
Expand Down

0 comments on commit 8ced6e4

Please sign in to comment.