[glib] thread: Remove the zero_thread
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] thread: Remove the zero_thread
- Date: Wed, 12 Oct 2011 22:22:54 +0000 (UTC)
commit ed35d2719ba60fe36032db6eae5e07cd45b4fe1c
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Oct 12 18:22:31 2011 -0400
thread: Remove the zero_thread
This was only used for redundant assertion checks.
glib/deprecated/gthread-deprecated.c | 2 --
glib/gthread.c | 8 +-------
glib/gthreadprivate.h | 1 -
3 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/glib/deprecated/gthread-deprecated.c b/glib/deprecated/gthread-deprecated.c
index 0a53fe2..46d8b85 100644
--- a/glib/deprecated/gthread-deprecated.c
+++ b/glib/deprecated/gthread-deprecated.c
@@ -148,8 +148,6 @@ guint64 (*g_thread_gettime) (void) = gettime;
/* Initialisation {{{1 ---------------------------------------------------- */
gboolean g_threads_got_initialized = TRUE;
-GSystemThread zero_thread; /* This is initialized to all zero */
-
/**
* g_thread_init:
diff --git a/glib/gthread.c b/glib/gthread.c
index 9e6f31e..4704227 100644
--- a/glib/gthread.c
+++ b/glib/gthread.c
@@ -677,11 +677,7 @@ g_thread_cleanup (gpointer data)
* If it is, the structure is freed in g_thread_join()
*/
if (!thread->thread.joinable)
- {
- /* Just to make sure, this isn't used any more */
- g_system_thread_assign (thread->system_thread, zero_thread);
- g_free (thread);
- }
+ g_free (thread);
}
}
@@ -891,7 +887,6 @@ g_thread_join (GThread *thread)
g_return_val_if_fail (thread, NULL);
g_return_val_if_fail (thread->joinable, NULL);
- g_return_val_if_fail (!g_system_thread_equal (&real->system_thread, &zero_thread), NULL);
g_system_thread_join (&real->system_thread);
@@ -899,7 +894,6 @@ g_thread_join (GThread *thread)
/* Just to make sure, this isn't used any more */
thread->joinable = 0;
- g_system_thread_assign (real->system_thread, zero_thread);
/* the thread structure for non-joinable threads is freed upon
* thread end. We free the memory here. This will leave a loose end,
diff --git a/glib/gthreadprivate.h b/glib/gthreadprivate.h
index 2b42620..2d6bc4f 100644
--- a/glib/gthreadprivate.h
+++ b/glib/gthreadprivate.h
@@ -72,7 +72,6 @@ struct _GRealThread
GSystemThread system_thread;
};
-G_GNUC_INTERNAL extern GSystemThread zero_thread;
G_GNUC_INTERNAL extern GMutex g_once_mutex;
/* initializers that may also use g_private_new() */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]