diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2016-11-20 12:24:57 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2016-11-20 12:24:57 (GMT) |
commit | 3b0c2b24da5689990c4bc0fcd3afecdf063086c8 (patch) | |
tree | 242d3501c98bef92e6befd920e8a9efdf2f1715b /src/H5system.c | |
parent | f6ad126673553838df0dec514c5d2c1b4b70df1a (diff) | |
download | hdf5-3b0c2b24da5689990c4bc0fcd3afecdf063086c8.zip hdf5-3b0c2b24da5689990c4bc0fcd3afecdf063086c8.tar.gz hdf5-3b0c2b24da5689990c4bc0fcd3afecdf063086c8.tar.bz2 |
Bring over support for retrying metadata cache entry loads, along with all the
supporting metadata cache callback changes, etc.
Diffstat (limited to 'src/H5system.c')
-rw-r--r-- | src/H5system.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/H5system.c b/src/H5system.c index ab08d2c..5205d08 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -911,6 +911,27 @@ Wflock(int fd, int operation) { return 0; } /* end Wflock() */ + + /*-------------------------------------------------------------------------- + * Function: Wnanosleep + * + * Purpose: Sleep for a given # of nanoseconds (Windows version) + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Fall 2016 + *-------------------------------------------------------------------------- + */ +void +Wnanosleep(uint64_t nanosec) +{ + /* XXX: Currently just a placeholder */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + FUNC_LEAVE_NOAPI_VOID +} /* end Wnanosleep() */ + #endif /* H5_HAVE_WIN32_API */ @@ -1108,3 +1129,63 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5_combine_path() */ + +/*-------------------------------------------------------------------------- + * Function: H5_nanosleep + * + * Purpose: Sleep for a given # of nanoseconds + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * October 01, 2016 + *-------------------------------------------------------------------------- + */ +void +H5_nanosleep(uint64_t nanosec) +{ + struct timespec sleeptime; /* Struct to hold time to sleep */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Set up time to sleep */ + sleeptime.tv_sec = 0; + sleeptime.tv_nsec = (long)nanosec; + + HDnanosleep(&sleeptime, NULL); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5_nanosleep() */ + + +/*-------------------------------------------------------------------------- + * Function: H5_get_time + * + * Purpose: Get the current time, as the time of seconds after the UNIX epoch + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * October 05, 2016 + *-------------------------------------------------------------------------- + */ +double +H5_get_time(void) +{ +#ifdef H5_HAVE_GETTIMEOFDAY + struct timeval curr_time; +#endif /* H5_HAVE_GETTIMEOFDAY */ + double ret_value = (double)0.0f; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + +#ifdef H5_HAVE_GETTIMEOFDAY + HDgettimeofday(&curr_time, NULL); + + ret_value = (double)curr_time.tv_sec + ((double)curr_time.tv_usec / (double)1000000.0f); +#endif /* H5_HAVE_GETTIMEOFDAY */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5_get_time() */ + + |