diff options
author | unknown <msvensson@shellback.> | 2006-12-14 15:23:44 +0100 |
---|---|---|
committer | unknown <msvensson@shellback.> | 2006-12-14 15:23:44 +0100 |
commit | 29bcffd77e32abc94600b9078f254b159a2dde8d (patch) | |
tree | f23da2855e569b61111327134ef1ba91ff7ff353 /server-tools | |
parent | a63a66cb46d16088fd9c634c2b0ebca0471e78ad (diff) | |
download | mariadb-git-29bcffd77e32abc94600b9078f254b159a2dde8d.tar.gz |
BUG#24687 func_misc test fails on win64
- Use same precision (milliseconds) for all time functions
used when calculating time for pthread_cond_timedwait
- Use 'GetSystemTimeAsFileTime' for both start and curr time
include/config-win.h:
Move all defines for 'pthread_cond_timedwait' to my_pthread.h
include/my_global.h:
Move all defines for 'pthread_cond_timedwait' to my_pthread.h
include/my_pthread.h:
Redefine "struct timespec" to better suite the needs
of 'pthread_cond_timedwait' for windows implementation
Add windows specific define for set_timespec_nsec
Move all defines related to pthread_cond_timed wait to same file
Declare union for reading FILETIME as __int64 with correct alignment
mysys/my_wincond.c:
Use 'GetSystemTimeAsFileTime()' both for getting start and current time
Use new members of "struct timespec"
Make sure the calculated timeout value never exceeds the value
passed to set_timespec/set_timespec_nsec
server-tools/instance-manager/guardian.cc:
Use set_timespec macro
server-tools/instance-manager/instance.cc:
Use set_timespec macro
Diffstat (limited to 'server-tools')
-rw-r--r-- | server-tools/instance-manager/guardian.cc | 5 | ||||
-rw-r--r-- | server-tools/instance-manager/instance.cc | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc index 0a037b5b98a..9fabb1923a8 100644 --- a/server-tools/instance-manager/guardian.cc +++ b/server-tools/instance-manager/guardian.cc @@ -228,9 +228,8 @@ void Guardian_thread::run() node= node->next; } - timeout.tv_sec= time(NULL) + monitoring_interval; - timeout.tv_nsec= 0; - + set_timespec(timeout, monitoring_interval); + /* check the loop predicate before sleeping */ if (!(shutdown_requested && (!(guarded_instances)))) thread_registry.cond_timedwait(&thread_info, &COND_guardian, diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index daa8082ef2f..39793b9a234 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -476,10 +476,9 @@ int Instance::stop() waitchild= options.shutdown_delay_val; kill_instance(SIGTERM); - /* sleep on condition to wait for SIGCHLD */ - timeout.tv_sec= time(NULL) + waitchild; - timeout.tv_nsec= 0; + /* sleep on condition to wait for SIGCHLD */ + set_timespec(timeout, waitchild); if (pthread_mutex_lock(&LOCK_instance)) return ER_STOP_INSTANCE; |