Index: glib/gthread.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gthread.c,v
retrieving revision 1.45
diff -u -r1.45 gthread.c
--- glib/gthread.c	12 Jul 2005 16:56:51 -0000	1.45
+++ glib/gthread.c	26 Sep 2005 05:08:23 -0000
@@ -76,6 +76,7 @@
 {
   GThread thread;
   gpointer private_data;
+  gpointer mem_private[16];
   gpointer retval;
   GSystemThread system_thread;
 };
@@ -581,7 +582,7 @@
   g_return_val_if_fail (priority >= G_THREAD_PRIORITY_LOW, NULL);
   g_return_val_if_fail (priority <= G_THREAD_PRIORITY_URGENT, NULL);
   
-  result = g_new (GRealThread, 1);
+  result = g_new0 (GRealThread, 1);
 
   result->thread.joinable = joinable;
   result->thread.priority = priority;
@@ -672,7 +673,7 @@
       /* If no thread data is available, provide and set one.  This
          can happen for the main thread and for threads, that are not
          created by GLib. */
-      thread = g_new (GRealThread, 1);
+      thread = g_new0 (GRealThread, 1);
       thread->thread.joinable = FALSE; /* This is a save guess */
       thread->thread.priority = G_THREAD_PRIORITY_NORMAL; /* This is
 							     just a guess */
@@ -839,6 +840,42 @@
       lock->write_cond = NULL;
     }
   g_static_mutex_free (&lock->mutex);
+}
+
+gpointer
+_g_thread_mem_private_get (GThread *thread,
+			   gint     i)
+{
+  GRealThread *real_thread = (GRealThread*) thread;
+
+  return real_thread->mem_private[i];
+}
+
+void
+_g_thread_mem_private_set (GThread *thread,
+			   gint     i,
+			   gpointer data)
+{
+  GRealThread *real_thread = (GRealThread*) thread;
+
+  real_thread->mem_private[i] = data;
+}
+
+void
+_g_thread_foreach (GFunc    func, 
+		   gpointer data)
+{
+  GSList *list;
+
+  list = g_thread_all_threads;
+  while (list)
+    {
+      GRealThread *thread = list->data;
+
+      (*func) (thread, data);
+
+      list = list->next;
+    }
 }
 
 #define __G_THREAD_C__
