glib/tests/refcount/Makefile.am
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

35 lines
857 B
Makefile

INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/glib \
-I$(top_srcdir)/gmodule \
$(GLIB_DEBUG_FLAGS)
libglib = $(top_builddir)/glib/libglib-2.0.la
libgthread = $(top_builddir)/gthread/libgthread-2.0.la
libgmodule = $(top_builddir)/gmodule/libgmodule-2.0.la
libgobject = $(top_builddir)/gobject/libgobject-2.0.la
LDADD = $(libgobject) $(libgthread)
test_programs = \
signal1 \
signal2 \
signal3 \
objects \
objects2 \
properties \
properties2
signal1_SOURCES = signals.c
signal1_CFLAGS = -DTESTNUM=1 $(AM_CFLAGS)
signal2_SOURCES = signals.c
signal2_CFLAGS = -DTESTNUM=2 $(AM_CFLAGS)
signal3_SOURCES = signals.c
signal3_CFLAGS = -DTESTNUM=3 $(AM_CFLAGS)
check_PROGRAMS = $(test_programs)
TESTS = $(test_programs)
TESTS_ENVIRONMENT = srcdir=$(srcdir) \
LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset