Skip to content

Commit

Permalink
Check if factories are initialized
Browse files Browse the repository at this point in the history
Signed-off-by: Quincey Koziol <[email protected]>
  • Loading branch information
qkoziol committed Jul 15, 2024
1 parent c6babd1 commit d2fe48f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/H5FL.c
Original file line number Diff line number Diff line change
Expand Up @@ -2545,9 +2545,10 @@ H5FL__fac_gc(void)
FUNC_ENTER_NOAPI_NOINIT

#ifdef H5_HAVE_CONCURRENCY
/* Acquire the mutex protecting the list of lists */
if (H5TS_dlftt_mutex_acquire(&H5FL_fac_gc_head.mutex) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTLOCK, FAIL, "can't lock list of list's mutex");
if (H5FL_fac_gc_head.init) {
/* Acquire the mutex protecting the list of lists */
if (H5TS_dlftt_mutex_acquire(&H5FL_fac_gc_head.mutex) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTLOCK, FAIL, "can't lock list of list's mutex");
#endif /* H5_HAVE_CONCURRENCY */

/* Walk through all the free lists, free()'ing the nodes */
Expand All @@ -2565,9 +2566,10 @@ H5FL__fac_gc(void)
assert(H5TS_atomic_load_size_t(&H5FL_fac_gc_head.mem_freed) == 0);

#ifdef H5_HAVE_CONCURRENCY
/* Release the mutex protecting the list of lists */
if (H5TS_dlftt_mutex_release(&H5FL_fac_gc_head.mutex) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTUNLOCK, FAIL, "can't unlock list of list's mutex");
/* Release the mutex protecting the list of lists */
if (H5TS_dlftt_mutex_release(&H5FL_fac_gc_head.mutex) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTUNLOCK, FAIL, "can't unlock list of list's mutex");
}
#endif /* H5_HAVE_CONCURRENCY */

done:
Expand Down

0 comments on commit d2fe48f

Please sign in to comment.