glib/glib
Matthias Clasen 39ea11ce6b Make refcounting threadsafe by using atomic operations. (#166020, Wim
2005-07-15  Matthias Clasen  <mclasen@redhat.com>

	Make refcounting threadsafe by using atomic
	operations.  (#166020, Wim Taymans)

	* gobject.c: Use a recursive lock to protect the
	notify queue.
	(g_object_unref): Get rid of g_object_last_unref and
	do the last unref handling in g_object_unref.
	(g_object_ref, g_object_unref): Use atomic operations.

	* gsignal.c (struct _HandlerMatch): Use a full integer
	for the ref_count field.
	(handler_ref, handler_unref_R): Use atomic operations.

	* gparam.c (g_param_spec_ref, g_param_spec_unref):
	Use atomic operations instead of a lock to make the
	refcounting threadsafe.

	* gclosure.c (g_closure_ref, g_closure_unref): Use atomic
	operations. This is more complicated here, since the
	refcount is stored in a bitfield, so we also have
	to access all other bitfield members atomically.

	* gsignal.c (handlers_find): Read the meta_marshal flag
	of the closure atomically.

	* tests/Makefile.am (SUBDIRS): Add tests/refcount

	* configure.in: Add tests/refcount

	* tests/refcount/properties.c: Test property changes
	from multiple threads.

	* tests/refcount/signals.c: Test signal emission from
	multiple threads.

	* tests/refcount/objects.c: Test refcounting from
	multiple threads.

	* tests/refcount/objects2.c:
	* tests/refcount/properties2.c: Tests to measure the
	overhead of threadsafe refcounting.

	* glib/giochannel.c (g_io_channel_ref, g_io_channel_unref):
	Use atomic operations to make refcounting
	threadsafe.  (#166020, Wim Taymans)
2005-07-15 16:51:10 +00:00
..
gnulib Undef libc functions before defining them, since they may also be macros. 2004-10-24 01:15:08 +00:00
libcharset Apply a patch to fix sparse warnings. (#154696, Kjartan Maraas) 2004-10-24 01:37:42 +00:00
trio Remove trio printf(). 2003-07-28 23:00:51 +00:00
.cvsignore Shut up CVS 2005-03-14 05:07:52 +00:00
abicheck.sh Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
galloca.h cpp #directives should always have the "#" in the first column of the the 2004-06-05 02:25:56 +00:00
garray.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
garray.h New function to call a function for each element of a GPtrArray. (#114790) 2003-12-26 01:04:12 +00:00
gasyncqueue.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gasyncqueue.h Make g_io_channel_ref(), g_main_context_ref(), g_hook_ref(), 2004-11-08 18:26:56 +00:00
gatomic.c Some fixes 2005-03-14 05:06:17 +00:00
gatomic.h Moved the assembler functions from gatomic.h to gatomic.c, which makes for 2004-02-29 16:48:37 +00:00
gbacktrace.c Apply a patch which may make GLib work on BeOS again. (#309157, Kian 2005-06-30 19:43:48 +00:00
gbacktrace.h ia32's G_BREAKPOINT() implementation works on amd64 too. Enable it. 2004-03-12 23:31:23 +00:00
gbsearcharray.h inserted casts for C++. 2003-09-07 22:36:58 +00:00
gcache.c Some fixes 2005-03-14 05:06:17 +00:00
gcache.h Move glib library into a subdirectory, make all GLib include files include 2001-06-26 16:01:21 +00:00
gcompletion.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gcompletion.h Add prototype for g_completion_complete_utf8(). 2004-02-05 01:58:47 +00:00
gconvert.c Don't call g_set_error() unless the GError pointer is non-NULL. This 2005-04-27 09:50:09 +00:00
gconvert.h Add g_filename_display_basename. 2004-12-15 16:34:49 +00:00
gdataset.c Add g_object_add/remove_toggle_ref() functions to get notification when a 2005-05-05 14:57:29 +00:00
gdataset.h Add g_object_add/remove_toggle_ref() functions to get notification when a 2005-05-05 14:57:29 +00:00
gdatasetprivate.h Add g_object_add/remove_toggle_ref() functions to get notification when a 2005-05-05 14:57:29 +00:00
gdate.c Add tests for g_date_get_iso8601_week_of_year(). 2005-03-28 05:22:56 +00:00
gdate.h Add a function to calculate the ISO 8601 week number of a date. (#92579, 2004-09-02 00:27:27 +00:00
gdebug.h Small cleanup (use G_BEGIN/END_DECLS). (#168474, Fabricio Barros Cabral) 2005-03-08 05:15:57 +00:00
gdir.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gdir.h Introduce the idea of a filename encoding, which is *literally* the 2004-10-27 16:46:29 +00:00
gen-unicode-tables.pl Size compose_table correctly. (#123421, Simon Josefsson) 2004-01-30 23:20:16 +00:00
gerror.c Minor stylistic fix 2005-06-10 13:24:02 +00:00
gerror.h Move glib library into a subdirectory, make all GLib include files include 2001-06-26 16:01:21 +00:00
gfileutils.c Fix a typo. (#310243, Richard Laager) 2005-07-13 18:59:46 +00:00
gfileutils.h Add some language-binding friendly variants 2005-06-23 05:50:53 +00:00
ghash.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
ghash.h One more parameter renamed 2005-05-01 22:28:57 +00:00
ghook.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
ghook.h Make g_io_channel_ref(), g_main_context_ref(), g_hook_ref(), 2004-11-08 18:26:56 +00:00
gi18n-lib.h Remove the ENABLE_NLS check here as well. 2004-07-12 04:03:50 +00:00
gi18n.h Remove the ENABLE_NLS check, since GLib can't be built without anyway. 2004-07-08 04:54:45 +00:00
giochannel.c Make refcounting threadsafe by using atomic operations. (#166020, Wim 2005-07-15 16:51:10 +00:00
giochannel.h Make g_io_channel_ref(), g_main_context_ref(), g_hook_ref(), 2004-11-08 18:26:56 +00:00
giounix.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
giowin32.c Totally rewritten socket channel implementation. See discussion in bug 2005-07-08 23:27:31 +00:00
gkeyfile.c And remove a redundant cast 2005-07-01 19:29:33 +00:00
gkeyfile.h Mark functions with G_GNUC_MALLOC when appropriate. 2004-11-28 19:12:04 +00:00
glib-object.h Include gtypes.h not gobject/gtype.h 2001-11-18 00:38:48 +00:00
glib.h Add an mmap() wrapper called GMappedFile. (#148218, David Schleef, Behdad 2005-06-25 03:38:32 +00:00
glib.rc.in Don't use autoconf variables for the resource object files on Win32 any 2005-07-08 23:04:06 +00:00
glib.symbols Add an mmap() wrapper called GMappedFile. (#148218, David Schleef, Behdad 2005-06-25 03:38:32 +00:00
glibintl.h 1.3.14 2002-02-17 23:28:43 +00:00
glist.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
glist.h Trivial s/foo/foo_/ fixes to make <glib.h> includable with -Wshadow 2002-11-08 18:47:56 +00:00
gmacros.h Define G_GNUC_NULL_TERMINATED. (#164706, Marc Meissner) 2005-03-08 05:41:45 +00:00
gmain.c Apply a patch which may make GLib work on BeOS again. (#309157, Kian 2005-06-30 19:43:48 +00:00
gmain.h Make g_io_channel_ref(), g_main_context_ref(), g_hook_ref(), 2004-11-08 18:26:56 +00:00
gmappedfile.c include <process.h> for getpid() include <io.h> for close() etc. add 2005-07-02 19:50:29 +00:00
gmappedfile.h Add an mmap() wrapper called GMappedFile. (#148218, David Schleef, Behdad 2005-06-25 03:38:32 +00:00
gmarkup.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gmarkup.h Add g_markup_printf_escaped(), g_markup_vprintf_escaped(). 2003-09-12 00:17:02 +00:00
gmem.c Add g_try_new, g_try_new0, g_try_renew and g_try_malloc0. (#169611, Stefan 2005-03-22 04:09:17 +00:00
gmem.h Add g_try_new, g_try_new0, g_try_renew and g_try_malloc0. (#169611, Stefan 2005-03-22 04:09:17 +00:00
gmessages.c include <process.h> for getpid() include <io.h> for close() etc. add 2005-07-02 19:50:29 +00:00
gmessages.h Use G_LOG_LEVEL_DEBUG in both definitions. (#300071, Tommi Komulainen) 2005-04-11 01:03:37 +00:00
gnode.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gnode.h Add G_TRAVERSE_LEAVES and G_TRAVERSE_NON_LEAVES as alternative names for 2004-11-08 19:14:04 +00:00
goption.c Warn if a short name is not acceptable. 2005-07-13 13:31:30 +00:00
goption.h Add and implement a new flag to turn off the automatic <groupname>- 2005-07-12 18:56:25 +00:00
gpattern.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gpattern.h make struct _GPatternSpec and GMatchType private. (g_pattern_equal): new 2001-10-13 05:54:10 +00:00
gprimes.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gprimes.h Move glib library into a subdirectory, make all GLib include files include 2001-06-26 16:01:21 +00:00
gprintf.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gprintf.h Synchronize argument names with headers and docs. (g_vasprintf): An 2003-06-05 22:47:42 +00:00
gprintfint.h Fix #147651, reported by Oliver Guntermann: 2004-07-21 17:51:28 +00:00
gqsort.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gqsort.h Use gchar, gint, gsize instead of char, int, size_t in the interface for 2003-07-29 18:59:23 +00:00
gquark.h Move glib library into a subdirectory, make all GLib include files include 2001-06-26 16:01:21 +00:00
gqueue.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gqueue.h Extend GQueue API to match the GList API. (#118439). 2004-02-21 12:48:08 +00:00
grand.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
grand.h Add the init_by_array functionality from the reference implementation of 2004-01-10 01:38:55 +00:00
grel.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
grel.h Trivial s/foo/foo_/ fixes to make <glib.h> includable with -Wshadow 2002-11-08 18:47:56 +00:00
gscanner.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gscanner.h fix comment. (g_ascii_strtoull): new function, acting like strtoull(3) in 2002-10-12 19:37:48 +00:00
gshell.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gshell.h Move glib library into a subdirectory, make all GLib include files include 2001-06-26 16:01:21 +00:00
gslist.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gslist.h Trivial s/foo/foo_/ fixes to make <glib.h> includable with -Wshadow 2002-11-08 18:47:56 +00:00
gspawn-win32-helper.c Also check errno to detect true errors from spawn*(). (#157258, reported 2004-11-30 02:27:22 +00:00
gspawn-win32.c Close the process handle if the called doesn't want it also in the case 2005-03-20 11:46:27 +00:00
gspawn.c Merged from glib-2-6: 2005-05-20 19:30:02 +00:00
gspawn.h Patch from J. Ali Harlow 2004-03-01 20:47:49 +00:00
gstdio.c Apply a patch which may make GLib work on BeOS again. (#309157, Kian 2005-06-30 19:43:48 +00:00
gstdio.h glib/gstdio.h glib/gstdio.c Add a chdir() wrapper, too. 2005-06-09 10:46:21 +00:00
gstrfuncs.c Warn and don't crash when meeting a trailing \\. (#301373, Benjamin Otte) 2005-04-28 20:47:51 +00:00
gstrfuncs.h Define G_GNUC_NULL_TERMINATED. (#164706, Marc Meissner) 2005-03-08 05:41:45 +00:00
gstring.c Fix portability issues. (#307064, Morten Welinder) 2005-06-30 19:50:43 +00:00
gstring.h actually enable (and fix up the length test). 2004-12-02 01:06:17 +00:00
gthread.c Don't lock if depth is zero. (#310148, Wim Taymans) 2005-07-12 16:56:51 +00:00
gthread.h Moved the assembler functions from gatomic.h to gatomic.c, which makes for 2004-02-29 16:48:37 +00:00
gthreadinit.h Update the returned value after locale changes. (#160271, Christian 2004-12-07 15:20:15 +00:00
gthreadpool.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gthreadpool.h Move glib library into a subdirectory, make all GLib include files include 2001-06-26 16:01:21 +00:00
gtimer.c On Win32, use GetSystemTimeAsFileTime() instead of GetTickCount(). 2005-03-20 11:35:48 +00:00
gtimer.h Add g_timer_continue(). (#98536, Tim-Philipp Müller) 2004-01-22 19:56:28 +00:00
gtree.c Check the return values of g_tree_remove(). 2005-05-17 15:33:36 +00:00
gtree.h Check the return values of g_tree_remove(). 2005-05-17 15:33:36 +00:00
gtypes.h Move GTranslateFunc to gtypes.h 2004-08-02 22:24:17 +00:00
gunibreak.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gunibreak.h Update Unicode data to 4.0. (#107974) 2003-07-31 02:27:56 +00:00
gunichartables.h Add g_unichar_get_mirror_char. (#114749) 2003-09-12 17:54:43 +00:00
gunicode.h New function to calculate collation keys which are more suitable for 2005-06-08 05:22:05 +00:00
gunicodeprivate.h Add a G_GNUC_INTERNAL macro to mark function declarations as internal and 2004-08-02 15:34:30 +00:00
gunicollate.c New function to calculate collation keys which are more suitable for 2005-06-08 05:22:05 +00:00
gunicomp.h Size compose_table correctly. (#123421, Simon Josefsson) 2004-01-30 23:20:16 +00:00
gunidecomp.c Don't eat Hangul when normalizing. (#301742, reported by Christian Biere, 2005-05-25 16:03:13 +00:00
gunidecomp.h Update Unicode data to 4.0. (#107974) 2003-07-31 02:27:56 +00:00
guniprop.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gutf8.c Make PLT-reduction work with gcc4, and don't include everything in 2005-03-14 04:26:57 +00:00
gutils.c Ignore anomalous environment entries which are not of the form 2005-07-10 04:44:27 +00:00
gutils.h New function. Returns the machine's name, or one of its names. Document 2005-06-22 08:54:28 +00:00
gwin32.c glib/gstdio.h glib/gstdio.c Add a chdir() wrapper, too. 2005-06-09 10:46:21 +00:00
gwin32.h Don't call g_set_error() unless the GError pointer is non-NULL. This 2005-04-27 09:50:09 +00:00
Makefile.am Don't use autoconf variables for the resource object files on Win32 any 2005-07-08 23:04:06 +00:00
makefile.mingw.in Hardcode 2.0 in the names, as that is what Makefile.am does. 2002-11-21 03:25:35 +00:00
makefile.msc.in include <process.h> for getpid() include <io.h> for close() etc. add 2005-07-02 19:50:29 +00:00
makegalias.pl Still need to include glibconfig.h 2005-03-14 04:30:25 +00:00