Make some changes to the way that GMainContext works:

Sat Jun 30 15:49:10 2001  Owen Taylor  <otaylor@redhat.com>

	* glib/gmain.[ch]: (Mostly patch from Sebastian Wilhemi)
	Make some changes to the way that GMainContext works:

	 - a GMainContext is no longer associated with a single
	   thread, but any thread can acquire ownership
	   of thread and iterate.

	 - There is a facility g_main_context_wait() for
	   non-owner-threads to wait either for ownership
	   or for a condition to be broadcast.

	 - For efficiency, GMainLoop just piggybacks of
	   of the loops mutex / condition instead of
	   having a separate mutex/condition for each
	   GMainLoop.

	* glib/gthread.[ch]: Remove hacks to store the thread's
	GMainContext in the GThread structures, since we
	no longer have the GMainContext <=> GThread correspondence.

        * glib/gmain.[ch]: Make g_main_context_wakeup() public
	so someone could completely duplicate GMainLoop
	with the public API.

	* tests/mainloop-test: Fix up to the new API. Decidedly
	doesn't work at the moment, but that may be the IO
	channel changes, or preexisting locking problems.
This commit is contained in:
Owen Taylor
2001-06-30 19:56:47 +00:00
committed by Owen Taylor
parent c88e252950
commit 8951f96c50
12 changed files with 699 additions and 206 deletions

View File

@@ -133,7 +133,7 @@ adder_thread (gpointer data)
GIOChannel **channels = data;
AddrData addr_data;
context = g_main_context_get (g_thread_self());
context = g_main_context_new ();
g_mutex_lock (context_array_mutex);