diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2021-03-03 00:04:42 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2021-03-03 00:04:42 (GMT) |
commit | 99237a729181c4143c91cf333575f27befd9cff3 (patch) | |
tree | c81b7db0749487dda4fcea26f5a225584938ee04 /src/H5Fvfd_swmr.c | |
parent | c7518ef2995ed060761c375223e797ea2f8c24bf (diff) | |
download | hdf5-99237a729181c4143c91cf333575f27befd9cff3.zip hdf5-99237a729181c4143c91cf333575f27befd9cff3.tar.gz hdf5-99237a729181c4143c91cf333575f27befd9cff3.tar.bz2 |
Switch to using H5_nanosleep() instead of HDnanosleep()
* Just in the main library and test/vfd_swmr.c
* VFD SWMR acceptance tests still use HDnanosleep() directly
Diffstat (limited to 'src/H5Fvfd_swmr.c')
-rw-r--r-- | src/H5Fvfd_swmr.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c index 1ff9ef7..76748fe 100644 --- a/src/H5Fvfd_swmr.c +++ b/src/H5Fvfd_swmr.c @@ -1916,39 +1916,25 @@ H5F__vfd_swmr_writer__wait_a_tick(H5F_t *f) struct timespec req; struct timespec rem; uint64_t tick_in_nsec; - H5F_shared_t *shared = f->shared; + H5F_shared_t *shared; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC + HDassert(f); + shared = f->shared; HDassert(shared->vfd_swmr); HDassert(shared->vfd_swmr_writer); tick_in_nsec = shared->vfd_swmr_config.tick_len * nanosecs_per_tenth_sec; - req.tv_nsec = (long)(tick_in_nsec % nanosecs_per_second); - req.tv_sec = (time_t)(tick_in_nsec / nanosecs_per_second); - - result = HDnanosleep(&req, &rem); - - while ( result == -1 ) { - - req = rem; - result = HDnanosleep(&req, &rem); - } - if ( result != 0 ) + H5_nanosleep(tick_in_nsec); - HGOTO_ERROR(H5E_FILE, H5E_SYSTEM, FAIL, "HDnanosleep() failed.") - - if ( H5F_vfd_swmr_writer_end_of_tick(f, FALSE) < 0 ) - - HGOTO_ERROR(H5E_FILE, H5E_SYSTEM, FAIL, \ - "H5F_vfd_swmr_writer_end_of_tick() failed.") + if (H5F_vfd_swmr_writer_end_of_tick(f, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_SYSTEM, FAIL, "H5F_vfd_swmr_writer_end_of_tick() failed") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5F__vfd_swmr_writer__wait_a_tick() */ herr_t |