Skip to content

Commit

Permalink
Re-order operations in thread cleanup code
Browse files Browse the repository at this point in the history
Signed-off-by: Quincey Koziol <[email protected]>
  • Loading branch information
qkoziol committed Dec 6, 2024
1 parent a094129 commit 1b1413c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/H5Iint.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ H5I__init_package(void)
/* Initialize the global atomic variables */
H5TS_atomic_init_int(&H5I_next_type_g, (int)H5I_NTYPES);

/* Initialize the mutices protecting the type information */
/* Initialize the mutexes protecting the type information */
for (unsigned u = 0; u < H5I_MAX_NUM_TYPES; u++) {
if (H5TS_dlftt_mutex_init(&H5I_type_info_array_g[u].mutex) < 0)
HGOTO_ERROR(H5E_ID, H5E_CANTINIT, FAIL,
Expand Down Expand Up @@ -220,7 +220,7 @@ H5I_term_package(void)
#ifdef H5_HAVE_CONCURRENCY
/* Indicate that the concurrency globals are initialized */
if (H5I_concur_gbl_init) {
/* Destroy the mutices protecting global type info array elements */
/* Destroy the mutexes protecting global type info array elements */
for (unsigned u = 0; u < H5I_MAX_NUM_TYPES; u++)
if (H5I_type_info_array_g[u].mutex_init) {
H5TS_dlftt_mutex_destroy(&H5I_type_info_array_g[u].mutex);
Expand Down
6 changes: 3 additions & 3 deletions src/H5TSint.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,15 +816,15 @@ H5TS__tinfo_destroy(void *_tinfo_node)
FUNC_ENTER_PACKAGE_NAMECHECK_ONLY

if (tinfo_node) {
/* Release resources held by error records in thread-local error stack */
H5E__destroy_stack(&tinfo_node->info.err_stack);

H5TS_mutex_lock(&H5TS_tinfo_mtx_s);

/* Add thread info node to the free list */
tinfo_node->next = H5TS_tinfo_next_free_s;
H5TS_tinfo_next_free_s = tinfo_node;

/* Release resources held by error records in thread-local error stack */
H5E__destroy_stack(&tinfo_node->info.err_stack);

H5TS_mutex_unlock(&H5TS_tinfo_mtx_s);
}

Expand Down

0 comments on commit 1b1413c

Please sign in to comment.