diff options
author | David Young <dyoung@hdfgroup.org> | 2020-02-07 20:57:46 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:31:55 (GMT) |
commit | f44798804d3d6e9a45418630db8f601e4f0acf12 (patch) | |
tree | 916cc3463575d65c4fd2f8fd4e5ee232ada3e192 /src | |
parent | 50d7f83e6eebcbdbc98dc599d853ce35ecbc82ab (diff) | |
download | hdf5-f44798804d3d6e9a45418630db8f601e4f0acf12.zip hdf5-f44798804d3d6e9a45418630db8f601e4f0acf12.tar.gz hdf5-f44798804d3d6e9a45418630db8f601e4f0acf12.tar.bz2 |
Make sure that H5TS_thread_id() is available as either a function or a macro in
all configurations.
Previously it was neither declared nor defined in --disable-threadsafety
builds. The compiler's warning got lost in the noise---I first saw the issue
because my -Werror branch stopped compiling cold---and the tests still linked
and ran.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5TS.c | 9 | ||||
-rw-r--r-- | src/H5private.h | 8 |
2 files changed, 5 insertions, 12 deletions
@@ -639,13 +639,4 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) } /* H5TS_create_thread */ -#else /* H5_HAVE_THREADSAFE */ - -uint64_t -H5TS_thread_id(void) -{ - return 0; -} - #endif /* H5_HAVE_THREADSAFE */ - diff --git a/src/H5private.h b/src/H5private.h index 297cef1..014b821 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1900,12 +1900,14 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ /* global library version information string */ extern char H5_lib_vers_info_g[]; +/* Include required thread-safety header, always, for the H5TS_thread_id() + * definition. + */ +#include "H5TSprivate.h" + /* Lock headers */ #ifdef H5_HAVE_THREADSAFE -/* Include required thread-safety header */ -#include "H5TSprivate.h" - /* replacement structure for original global variable */ typedef struct H5_api_struct { H5TS_mutex_t init_lock; /* API entrance mutex */ |