summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <msvensson@shellback.>2006-12-18 11:09:47 +0100
committerunknown <msvensson@shellback.>2006-12-18 11:09:47 +0100
commit43a251011cf7413c3d6728d6f447b78344259c1d (patch)
tree0bfd45a59903cc983e25b689312596a8ff9a76a1 /include
parente1411580c15de8051640448359a5eb7bd4c02b62 (diff)
downloadmariadb-git-43a251011cf7413c3d6728d6f447b78344259c1d.tar.gz
Change windows pthread_cond_timedwait to use an absolute time value
include/my_pthread.h: Calculate absolute time value int set_timespec_* mysys/my_wincond.c: Use absolute timevalue in pthread_cond_timedwwait
Diffstat (limited to 'include')
-rw-r--r--include/my_pthread.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index ebba0ab32e1..631ca1d7c03 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -94,17 +94,19 @@ typedef void * (__cdecl *pthread_handler)(void *);
__int64 i64;
};
struct timespec {
- union ft64 start;
+ union ft64 tv;
/* The max timeout value in millisecond for pthread_cond_timedwait */
- long timeout_msec;
+ long max_timeout_msec;
};
#define set_timespec(ABSTIME,SEC) { \
- GetSystemTimeAsFileTime(&((ABSTIME).start.ft)); \
- (ABSTIME).timeout_msec= (long)((SEC)*1000); \
+ GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
+ (ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \
+ (ABSTIME).max_timeout_msec= (long)((SEC)*1000); \
}
#define set_timespec_nsec(ABSTIME,NSEC) { \
- GetSystemTimeAsFileTime(&((ABSTIME).start.ft)); \
- (ABSTIME).timeout_msec= (long)((NSEC)/1000000); \
+ GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
+ (ABSTIME).tv.i64+= (__int64)(NSEC)/100; \
+ (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
}
void win_pthread_init(void);