summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-01-12 17:08:52 +0200
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-01-12 17:08:52 +0200
commit7f9ce73d494f24e47c6fc5d41c004489a91958ad (patch)
treeda0982c91ebe6b9ce8a91a26ba09fb425b1341dc /mysys
parent651313bf91d7771831de7228bb4130f0ac64c33a (diff)
parent33c78e328f4d8238b7b53c246e28bb44a97ee3c0 (diff)
downloadmariadb-git-7f9ce73d494f24e47c6fc5d41c004489a91958ad.tar.gz
merge
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_getsystime.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c
index b692b18bfc7..dfd99f6380d 100644
--- a/mysys/my_getsystime.c
+++ b/mysys/my_getsystime.c
@@ -170,7 +170,13 @@ ulonglong my_micro_time_and_time(time_t *time_arg)
pthread_mutex_lock(&THR_LOCK_time);
cur_gethrtime= gethrtime();
- if ((cur_gethrtime - prev_gethrtime) > DELTA_FOR_SECONDS)
+ /*
+ Due to bugs in the Solaris (x86) implementation of gethrtime(),
+ the time returned by it might not be monotonic. Don't use the
+ cached time(2) value if this is a case.
+ */
+ if ((prev_gethrtime > cur_gethrtime) ||
+ ((cur_gethrtime - prev_gethrtime) > DELTA_FOR_SECONDS))
{
cur_time= time(0);
prev_gethrtime= cur_gethrtime;