summaryrefslogtreecommitdiff
path: root/gthread
diff options
context:
space:
mode:
Diffstat (limited to 'gthread')
-rw-r--r--gthread/gthread-impl.c2
-rw-r--r--gthread/gthread-none.c2
-rw-r--r--gthread/gthread-posix.c29
-rw-r--r--gthread/gthread-win32.c16
4 files changed, 1 insertions, 48 deletions
diff --git a/gthread/gthread-impl.c b/gthread/gthread-impl.c
index 678b3b8fe..97a497089 100644
--- a/gthread/gthread-impl.c
+++ b/gthread/gthread-impl.c
@@ -315,8 +315,6 @@ g_thread_init (GThreadFunctions* init)
g_thread_use_default_impl = FALSE;
g_thread_functions_for_glib_use = *init;
- if (g_thread_gettime_impl)
- g_thread_gettime = g_thread_gettime_impl;
supported = (init->mutex_new &&
init->mutex_lock &&
diff --git a/gthread/gthread-none.c b/gthread/gthread-none.c
index 6fbeff160..fb4c88710 100644
--- a/gthread/gthread-none.c
+++ b/gthread/gthread-none.c
@@ -34,6 +34,4 @@
static GThreadFunctions
g_thread_functions_for_glib_use_default; /* is NULLified */
-static guint64 (*g_thread_gettime_impl) (void) = NULL;
-
#define G_MUTEX_SIZE 0
diff --git a/gthread/gthread-posix.c b/gthread/gthread-posix.c
index 9188f843e..5fbcf2803 100644
--- a/gthread/gthread-posix.c
+++ b/gthread/gthread-posix.c
@@ -119,12 +119,7 @@ static gulong g_thread_min_stack_size = 0;
#define G_MUTEX_SIZE (sizeof (pthread_mutex_t))
-#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_MONOTONIC_CLOCK)
-#define USE_CLOCK_GETTIME 1
-static gint posix_clock = 0;
-#endif
-
-#if defined(_SC_THREAD_STACK_MIN) || defined (HAVE_PRIORITIES) || defined (USE_CLOCK_GETTIME)
+#if defined(_SC_THREAD_STACK_MIN) || defined (HAVE_PRIORITIES)
#define HAVE_G_THREAD_IMPL_INIT
static void
g_thread_impl_init(void)
@@ -146,13 +141,6 @@ g_thread_impl_init(void)
g_thread_priority_map [priority]));
# endif
#endif /* HAVE_PRIORITIES */
-
-#ifdef USE_CLOCK_GETTIME
- if (sysconf (_SC_MONOTONIC_CLOCK) >= 0)
- posix_clock = CLOCK_MONOTONIC;
- else
- posix_clock = CLOCK_REALTIME;
-#endif
}
#endif /* _SC_THREAD_STACK_MIN || HAVE_PRIORITIES */
@@ -426,21 +414,6 @@ g_thread_equal_posix_impl (gpointer thread1, gpointer thread2)
return (pthread_equal (*(pthread_t*)thread1, *(pthread_t*)thread2) != 0);
}
-#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;
-}
-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 =
{
g_mutex_new_posix_impl,
diff --git a/gthread/gthread-win32.c b/gthread/gthread-win32.c
index 465b20550..c72d061b1 100644
--- a/gthread/gthread-win32.c
+++ b/gthread/gthread-win32.c
@@ -545,22 +545,6 @@ g_thread_join_win32_impl (gpointer thread)
g_free (target);
}
-static guint64
-g_thread_gettime_impl (void)
-{
- guint64 v;
-
- /* Returns 100s of nanoseconds since start of 1601 */
- GetSystemTimeAsFileTime ((FILETIME *)&v);
-
- /* Offset to Unix epoch */
- v -= G_GINT64_CONSTANT (116444736000000000);
- /* Convert to nanoseconds */
- v *= 100;
-
- return v;
-}
-
static GThreadFunctions g_thread_functions_for_glib_use_default =
{
g_mutex_new_win32_impl, /* mutex */