mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-04 08:23:38 +02:00
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)
This commit is contained in:
committed by
Matthias Clasen
parent
58729b464b
commit
39ea11ce6b
@@ -1,5 +1,26 @@
|
||||
2005-07-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* 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)
|
||||
|
||||
* NEWS: Updates
|
||||
|
||||
2005-07-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
Reference in New Issue
Block a user