From 68a5541b776b53fd2bcb6c795595998cb8c8b2a6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 20 Sep 2024 16:49:54 -0500 Subject: [PATCH] Fixups after merging from TOT Signed-off-by: Quincey Koziol --- src/CMakeLists.txt | 1 - src/Makefile.am | 2 +- test/ttsafe.c | 3 +-- test/ttsafe.h | 11 +++++++---- test/ttsafe_atomic.c | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ad7eec26d9..47fc1dcf751 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -644,7 +644,6 @@ set (H5TS_SOURCES ${HDF5_SRC_DIR}/H5TSbarrier.c ${HDF5_SRC_DIR}/H5TSc11.c ${HDF5_SRC_DIR}/H5TScond.c - ${HDF5_SRC_DIR}/H5TSffs_rwlock.c ${HDF5_SRC_DIR}/H5TSint.c ${HDF5_SRC_DIR}/H5TSkey.c ${HDF5_SRC_DIR}/H5TSmutex.c diff --git a/src/Makefile.am b/src/Makefile.am index cc7ec3fe4c5..a233fadcfd2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,7 +98,7 @@ libhdf5_la_SOURCES= H5.c H5build_settings.c H5checksum.c H5dbg.c H5system.c \ H5Tfloat.c H5Tinit_float.c H5Tnative.c H5Toffset.c H5Toh.c H5Topaque.c \ H5Torder.c H5Tref.c H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c \ H5Tvlen.c \ - H5TS.c H5TSatomic.c H5TSbarrier.c H5TSc11.c H5TScond.c H5TSffs_rwlock.c \ + H5TS.c H5TSatomic.c H5TSbarrier.c H5TSc11.c H5TScond.c \ H5TSint.c H5TSkey.c H5TSmutex.c H5TSonce.c H5TSpool.c H5TSpthread.c \ H5TSrec_rwlock.c H5TSrwlock.c H5TSsemaphore.c H5TSthread.c H5TSwin.c \ H5VL.c H5VLcallback.c H5VLdyn_ops.c H5VLint.c H5VLnative.c \ diff --git a/test/ttsafe.c b/test/ttsafe.c index 9728a594f23..38f77da74de 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -141,10 +141,9 @@ main(int argc, char *argv[]) "recursive R/W lock smoke check 4 -- mixed mob", NULL); #endif /* !H5_HAVE_WIN_THREADS */ AddTest("semaphore", tts_semaphore, NULL, "lightweight system semaphores", NULL); - -#ifdef H5_HAVE_THREADSAFE_API AddTest("thread_id", tts_thread_id, NULL, "thread IDs", NULL); +#ifdef H5_HAVE_THREADSAFE_API AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); #ifdef H5_HAVE_PTHREAD_H diff --git a/test/ttsafe.h b/test/ttsafe.h index 87ca01f5c52..d8a19fc4c64 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -38,22 +38,25 @@ extern char *gen_name(int); void tts_is_threadsafe(void); #ifdef H5_HAVE_THREADS void tts_thread_pool(void); +#ifndef H5_HAVE_STDATOMIC_H +/* C11 atomics only tested when emulated */ void tts_atomics(void); +#endif /* H5_HAVE_STDATOMIC_H */ void tts_rwlock(void); -void tts_semaphore(void); #ifndef H5_HAVE_WIN_THREADS void tts_rec_rwlock_smoke_check_1(void); void tts_rec_rwlock_smoke_check_2(void); void tts_rec_rwlock_smoke_check_3(void); void tts_rec_rwlock_smoke_check_4(void); #endif /* !H5_HAVE_WIN_THREADS */ -#ifdef H5_HAVE_THREADSAFE +void tts_semaphore(void); +void tts_thread_id(void); +#ifdef H5_HAVE_THREADSAFE_API void tts_dcreate(void); void tts_error(void); void tts_cancel(void); void tts_acreate(void); void tts_attr_vlen(void); -void tts_thread_id(void); void tts_develop_api(void); /* Prototypes for the cleanup routines */ @@ -63,6 +66,6 @@ void cleanup_cancel(void); void cleanup_acreate(void); void cleanup_attr_vlen(void); -#endif /* H5_HAVE_THREADSAFE */ +#endif /* H5_HAVE_THREADSAFE_API */ #endif /* H5_HAVE_THREADS */ #endif /* TTSAFE_H */ diff --git a/test/ttsafe_atomic.c b/test/ttsafe_atomic.c index c084ec75748..64608baf6d3 100644 --- a/test/ttsafe_atomic.c +++ b/test/ttsafe_atomic.c @@ -17,7 +17,7 @@ #include "ttsafe.h" -#ifdef H5_HAVE_THREADS +#if defined(H5_HAVE_THREADS) && !defined(H5_HAVE_STDATOMIC_H) #define NUM_THREADS 16 @@ -175,4 +175,4 @@ tts_atomics(void) } /* end tts_atomics() */ -#endif /* H5_HAVE_THREADS */ +#endif /* defined(H5_HAVE_THREADS) && !defined(H5_HAVE_STDATOMIC_H) */