mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-03 12:19:20 +02:00
Revert an accidental ABI break by moving gettime out of the
2007-01-16 Matthias Clasen <mclasen@redhat.com> * glib/gthread.h: * glib/gthread.c: * glib/glib.symbols: Revert an accidental ABI break by moving gettime out of the GThreadFunctions struct and making it a separate variable. (#397139, Joe Marcus Clarke) * gthread/*.c: Adapt. svn path=/branches/glib-2-12/; revision=5280
This commit is contained in:
committed by
Matthias Clasen
parent
4c49bbeec1
commit
281d14029d
@@ -426,23 +426,20 @@ g_thread_equal_posix_impl (gpointer thread1, gpointer thread2)
|
||||
return (pthread_equal (*(pthread_t*)thread1, *(pthread_t*)thread2) != 0);
|
||||
}
|
||||
|
||||
static guint64
|
||||
g_gettime_posix_impl (void)
|
||||
{
|
||||
#ifdef USE_CLOCK_GETTIME
|
||||
static guint64
|
||||
gettime (void)
|
||||
{
|
||||
struct timespec tv;
|
||||
|
||||
clock_gettime (posix_clock, &tv);
|
||||
|
||||
return (guint64) tv.tv_sec * G_NSEC_PER_SEC + tv.tv_nsec;
|
||||
#else
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday (&tv, NULL);
|
||||
|
||||
return (guint64) tv.tv_sec * G_NSEC_PER_SEC + tv.tv_usec * (G_NSEC_PER_SEC / G_USEC_PER_SEC);
|
||||
#endif
|
||||
}
|
||||
static guint64 (*g_thread_gettime_impl)(void) = gettime;
|
||||
#else
|
||||
static guint64 (*g_thread_gettime_impl)(void) = 0;
|
||||
#endif
|
||||
|
||||
static GThreadFunctions g_thread_functions_for_glib_use_default =
|
||||
{
|
||||
@@ -466,6 +463,5 @@ static GThreadFunctions g_thread_functions_for_glib_use_default =
|
||||
g_thread_exit_posix_impl,
|
||||
g_thread_set_priority_posix_impl,
|
||||
g_thread_self_posix_impl,
|
||||
g_thread_equal_posix_impl,
|
||||
g_gettime_posix_impl
|
||||
g_thread_equal_posix_impl
|
||||
};
|
||||
|
Reference in New Issue
Block a user