6 Commits

Author SHA1 Message Date
Sebastian Wilhelmi
a5ae4f8f99 Made the thread related code follow GNU coding standard.
1998-12-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* Made the thread related code follow GNU coding standard.

	* Made a comment (HOLDS:) above each function, that expects the
	given locks to be held.

	* Changed try_lock to trylock throughout.

	* glib.c: Eventually removed the #if 0'ed code for old GStaticMutex.

	* glib.c: Corrected g_trylock macro for G_DEBUG_LOCKS.

	* gmain.c (g_main_poll_add_unlocked): first take a new poll record
	form the poll_free_list.

	* gmem.c, gstrfuncs.c, gutils.c: Made it MT safe.

	* gthraed/*.c: Added copyright headers.

	* gthread/gthread-solaris.c: do not use g_log for errors, as g_log
	uses these module and endless recursions might happen, just use a
	plain fprintf(stderr,...).

	* gthread/gthread.c (g_thread_try_init): Call g_mutex_init().

	* gthread/testgthread.c: updated test program.
1998-12-09 14:55:11 +00:00
Owen Taylor
7bb4602aa1 Checking in work on GLib thread-safety into a branch.
Tue Dec  8 18:49:56 1998  Owen Taylor  <otaylor@redhat.com>

	* Start at adding thread-safety. (mostly work
	of Sebastian Wilhelmi <wilhelmi@ira.uka.de>)

	- configure.in now looks for a system thread implementation.
	Currently support is included for POSIX threads
	and Solaris threads. The default support is built
	into a separate library -lgthread.

	- The thread implementation can be modified by passing
	a vector of functions g_thread_init().

	- The default or supplied functions are used to
	implement a small set of thread functions for
	mutexes, condition variables, and thread-private
	data.

	- GLib now uses these functions to provide thread
	safety. (In the sense that all global static
	data is locked... individual structures must still
	be locked by the caller.)
1998-12-08 23:56:27 +00:00
Tim Janik
9c1692c260 removed the GListAllocator type and its g_*_allocator_*() function
Tue Nov 24 09:40:00 1998  Tim Janik  <timj@gtk.org>

        * glib.h: removed the GListAllocator type and its g_*_allocator_*()
        function variants (which weren't working anyways) in favour of a
        generic GAllocator type. new functions:
        g_allocator_new, g_allocator_free, g_slist_push_allocator,
        g_slist_pop_allocator, g_list_push_allocator, g_list_pop_allocator,
        g_node_push_allocator and g_node_pop_allocator.

        * gstring.c: removed bogus slist allocator code.
        * gtree.c: maintain own list of free tree nodes and don't waste
        GSLists for that, removed bogus slist allocator code.
        * glist.c: use GAllocators for node allocation.
        * gslist.c: use GAllocators for node allocation.
        * gnode.c: use GAllocators for node allocation.

        * gdataset.c: cleanups wrt automatic initialization.
1998-11-24 12:18:22 +00:00
Tim Janik
70a6dbff87 new function g_slist_copy() to duplicate a list with all its data
Sun Nov 22 17:07:03 1998  Tim Janik  <timj@gtk.org>

        * glib.h:
        * gslist.c: new function g_slist_copy() to duplicate a list with all its
        data pointers.
        * glist.c: new function g_list_copy.
1998-11-23 01:52:07 +00:00
Owen Taylor
be7ab912ee Added g_list_sort() and g_slist_sort() to merge sort GLists and GSLists.
Fri Nov 13 15:17:34 1998  Owen Taylor  <otaylor@redhat.com>

	* glist.c gslist.c glib.h: Added g_list_sort() and
	g_slist_sort() to merge sort GLists and GSLists.
	Submitted by Sven Over <sven.over@ob.kamp.net>
	over a year ago!

	* testglib.c: Test the new sort functions.
1998-11-13 20:50:41 +00:00
Owen Taylor
2e0320d57e Initial revision 1998-06-10 23:21:14 +00:00