Skip to content

Commit

Permalink
Acquire lock in all internal H5PL routines
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala committed Dec 6, 2024
1 parent 0f5a848 commit f2efeaf
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 62 deletions.
28 changes: 14 additions & 14 deletions src/H5PLint.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ H5PL__get_plugin_control_mask(unsigned int *mask /*out*/)
{
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_PACKAGE_NOERR
FUNC_ENTER_PACKAGE_NOERR_MUTEX

/* Check args - Just assert on package functions */
assert(mask);

/* Return the mask */
*mask = H5PL_plugin_control_mask_g;

FUNC_LEAVE_NOAPI(ret_value)
FUNC_LEAVE_NOAPI_MUTEX(ret_value)

} /* end H5PL__get_plugin_control_mask() */

Expand All @@ -105,7 +105,7 @@ H5PL__set_plugin_control_mask(unsigned int mask)
{
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_PACKAGE_NOERR
FUNC_ENTER_PACKAGE_NOERR_MUTEX

/* Only allow setting this if plugins have not been disabled.
* XXX: Note that we don't consider this an error, but instead
Expand All @@ -115,7 +115,7 @@ H5PL__set_plugin_control_mask(unsigned int mask)
if (H5PL_allow_plugins_g)
H5PL_plugin_control_mask_g = mask;

FUNC_LEAVE_NOAPI(ret_value)
FUNC_LEAVE_NOAPI_MUTEX(ret_value)

} /* end H5PL__set_plugin_control_mask() */

Expand All @@ -134,7 +134,7 @@ H5PL_init(void)
char *env_var = NULL;
herr_t ret_value = SUCCEED;

FUNC_ENTER_NOAPI(FAIL)
FUNC_ENTER_NOAPI_MUTEX(FAIL)

/* Check the environment variable to determine if the user wants
* to ignore plugins. The special symbol H5PL_NO_PLUGIN (defined in
Expand All @@ -155,7 +155,7 @@ H5PL_init(void)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINIT, FAIL, "can't create plugin search path table");

done:
FUNC_LEAVE_NOAPI(ret_value)
FUNC_LEAVE_NOAPI_MUTEX(ret_value)
}

/*-------------------------------------------------------------------------
Expand All @@ -177,7 +177,7 @@ H5PL_term_package(void)
hbool_t already_closed = FALSE;
int ret_value = 0;

FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_NOAPI_NOINIT_MUTEX

/* Close the plugin cache.
* We need to bump the return value if we did any real work here.
Expand All @@ -192,7 +192,7 @@ H5PL_term_package(void)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTFREE, (-1), "problem closing search path table");

done:
FUNC_LEAVE_NOAPI(ret_value)
FUNC_LEAVE_NOAPI_MUTEX(ret_value)
} /* end H5PL_term_package() */

/*-------------------------------------------------------------------------
Expand All @@ -217,7 +217,7 @@ H5PL_load(H5PL_type_t type, const H5PL_key_t *key)
const void *plugin_info = NULL; /* Information from the plugin */
const void *ret_value = NULL;

FUNC_ENTER_NOAPI(NULL)
FUNC_ENTER_NOAPI_MUTEX(NULL)

/* Check if plugins can be loaded for this plugin type */
switch (type) {
Expand Down Expand Up @@ -267,7 +267,7 @@ H5PL_load(H5PL_type_t type, const H5PL_key_t *key)
"or path set by H5PLxxx functions");

done:
FUNC_LEAVE_NOAPI(ret_value)
FUNC_LEAVE_NOAPI_MUTEX(ret_value)
} /* end H5PL_load() */

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -326,7 +326,7 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *s
H5PL_key_t tmp_key;
herr_t ret_value = SUCCEED;

FUNC_ENTER_PACKAGE
FUNC_ENTER_PACKAGE_MUTEX

/* Check args - Just assert on package functions */
assert(path);
Expand Down Expand Up @@ -464,7 +464,7 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *s
if (H5PL__close(handle) < 0)
HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library");

FUNC_LEAVE_NOAPI(ret_value)
FUNC_LEAVE_NOAPI_MUTEX(ret_value)
} /* end H5PL__open() */
H5_GCC_CLANG_DIAG_ON("pedantic")

Expand All @@ -480,11 +480,11 @@ H5_GCC_CLANG_DIAG_ON("pedantic")
herr_t
H5PL__close(H5PL_HANDLE handle)
{
FUNC_ENTER_PACKAGE_NOERR
FUNC_ENTER_PACKAGE_NOERR_MUTEX

H5PL_CLOSE_LIB(handle);

FUNC_LEAVE_NOAPI(SUCCEED)
FUNC_LEAVE_NOAPI_MUTEX(SUCCEED)
} /* end H5PL__close() */

/*-------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit f2efeaf

Please sign in to comment.