Dep/MySQL: Updated MySQL sources to version 5.5.9 (current GA)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2004 MySQL AB
|
||||
/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,10 +25,6 @@
|
||||
#include "mysys_priv.h"
|
||||
#include "my_static.h"
|
||||
|
||||
#ifdef __NETWARE__
|
||||
#include <nks/time.h>
|
||||
#endif
|
||||
|
||||
ulonglong my_getsystime()
|
||||
{
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
@@ -45,10 +41,6 @@ ulonglong my_getsystime()
|
||||
query_performance_frequency) + query_performance_offset);
|
||||
}
|
||||
return 0;
|
||||
#elif defined(__NETWARE__)
|
||||
NXTime_t tm;
|
||||
NXGetTime(NX_SINCE_1970, NX_NSECONDS, &tm);
|
||||
return (ulonglong)tm/100;
|
||||
#else
|
||||
/* TODO: check for other possibilities for hi-res timestamping */
|
||||
struct timeval tv;
|
||||
@@ -150,7 +142,10 @@ ulonglong my_micro_time()
|
||||
Value in microseconds from some undefined point in time
|
||||
*/
|
||||
|
||||
#define DELTA_FOR_SECONDS LL(500000000) /* Half a second */
|
||||
#define DELTA_FOR_SECONDS 500000000LL /* Half a second */
|
||||
|
||||
/* Difference between GetSystemTimeAsFileTime() and now() */
|
||||
#define OFFSET_TO_EPOCH 116444736000000000ULL
|
||||
|
||||
ulonglong my_micro_time_and_time(time_t *time_arg)
|
||||
{
|
||||
@@ -168,15 +163,21 @@ ulonglong my_micro_time_and_time(time_t *time_arg)
|
||||
static time_t cur_time= 0;
|
||||
hrtime_t cur_gethrtime;
|
||||
|
||||
pthread_mutex_lock(&THR_LOCK_time);
|
||||
mysql_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;
|
||||
}
|
||||
*time_arg= cur_time;
|
||||
pthread_mutex_unlock(&THR_LOCK_time);
|
||||
mysql_mutex_unlock(&THR_LOCK_time);
|
||||
return cur_gethrtime/1000;
|
||||
#else
|
||||
ulonglong newtime;
|
||||
|
||||
Reference in New Issue
Block a user