summaryrefslogtreecommitdiff
path: root/tests/refcount
Commit message (Collapse)AuthorAgeFilesLines
* Add a missing reference to libglib in the LDADD for this test.Billy Biggs2005-11-071-1/+1
| | | | | | | 2005-11-07 Billy Biggs <vektor@dumbterm.net> * tests/refcount/Makefile.am: Add a missing reference to libglib in the LDADD for this test.
* Link the the refcount tests to the system thread library $(G_THREAD_LIBS).Sebastian Wilhelmi2005-09-111-1/+1
| | | | | | | | 2005-09-11 Sebastian Wilhelmi <seppi@seppi.de> * tests/refcount/Makefile.am (INCLUDES): Link the the refcount tests to the system thread library $(G_THREAD_LIBS). Fixes #313744 and #314217.
* remove unused n_threads variable.Manish Singh2005-08-061-1/+0
| | | | | | 2005-08-05 Manish Singh <yosh@gimp.org> * tests/refcount/closures.c: remove unused n_threads variable.
* Shut up CVSManish Singh2005-08-061-0/+1
|
* tests/refcount/objects.c tests/refcount/properties.c Use g_usleep()Tor Lillqvist2005-08-023-3/+3
| | | | | | | | | 2005-08-02 Tor Lillqvist <tml@novell.com> * tests/refcount/objects.c * tests/refcount/properties.c * tests/refcount/signals.c: Use g_usleep() instead of sleep() for portability.
* test high contention on closure reference counts to trigger and catchTim Janik2005-08-017-38/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mon Aug 1 23:33:47 2005 Tim Janik <timj@imendio.com> * tests/refcount/closures.c: test high contention on closure reference counts to trigger and catch non-atomic updates. * tests/refcount/objects.c: * tests/refcount/objects2.c: * tests/refcount/properties.c: * tests/refcount/properties2.c: * tests/refcount/signals.c: fixed up test and threading fundamentals. variables accessed from all threads need to be volatile. context switches are enforced by using g_thread_yield(), not g_usleep(1) which may result in busy waits on some platforms. for testcode, always consider all warnings and critical messages fatal. issue the currently running program on stdout. improved progress indicators. * tests/refcount/properties.c: * tests/refcount/objects.c: don't overdo the number of testing threads to keep the testing machine usable, 2 threads can produce as much contention as 20 if executing the same code. * tests/refcount/signals.c: only start 1 thread per object. GObject doesn't provide mutually exclusive object access, but only mutually exclusive reference count modification. * tests/Makefile.am: added closures test.
* use G_CALLBACK for signal connections.Manish Singh2005-07-201-3/+3
| | | | | | 2005-07-20 Manish Singh <yosh@gimp.org> * tests/refcount/signals.c: use G_CALLBACK for signal connections.
* Shut up CVSManish Singh2005-07-201-0/+9
|
* Make refcounting threadsafe by using atomic operations. (#166020, WimMatthias Clasen2005-07-156-0/+1030
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)