summaryrefslogtreecommitdiff
path: root/include/my_pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r--include/my_pthread.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index a7e4ea25064..a2476d4265c 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -426,9 +426,9 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{ \
- ulonglong now= my_getsystime() + (NSEC/100); \
- (ABSTIME).ts_sec= (now / ULL(10000000)); \
- (ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
+ ulonglong now= my_hrtime().val*1000 + (NSEC); \
+ (ABSTIME).ts_sec= now / 1000000000ULL; \
+ (ABSTIME).ts_nsec= now % 1000000000ULL; \
}
#endif /* !set_timespec_nsec */
#else
@@ -444,9 +444,9 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
- ulonglong now= my_getsystime() + (NSEC/100); \
- (ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \
- (ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
+ ulonglong now= my_hrtime().val*1000 + (NSEC); \
+ (ABSTIME).tv_sec= (time_t) (now / 1000000000ULL); \
+ (ABSTIME).tv_nsec= (long) (now % 1000000000ULL); \
}
#endif /* !set_timespec_nsec */
#endif /* HAVE_TIMESPEC_TS_SEC */