diff options
author | Tim Janik <timj@gtk.org> | 2005-07-30 19:46:11 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2005-07-30 19:46:11 +0000 |
commit | f0cfc267ba9d4366679fd485f363f9130433ef2e (patch) | |
tree | 63e7586a39fd5fa5e4d0080d8194f5fae47bd347 /gobject/gsignal.c | |
parent | 84132e92982af4a9c3cb5492ebdc79c268a44236 (diff) |
reverted notify_mutex introduction, since this prevents parallelized
Sat Jul 30 21:10:26 2005 Tim Janik <timj@gtk.org>
* gobject.c: reverted notify_mutex introduction, since this prevents
parallelized setting of object properties on different objects, and
serves no apparent purpose (to me at least).
g_object_real_dispose(): removed non-atomic reference count
modifications.
g_object_unref(): make sure the closures array is destroyed when
destroying signal handlers.
* gparam.c: cosmetic changes.
* gsignal.c: comment fixup. allow 16bit blocking count.
* gsignal.c: reverted GClosure related changes.
* gclosure.c: reverted premature commit of atomic reference
counting attempt.
Diffstat (limited to 'gobject/gsignal.c')
-rw-r--r-- | gobject/gsignal.c | 83 |
1 files changed, 30 insertions, 53 deletions
diff --git a/gobject/gsignal.c b/gobject/gsignal.c index b834fd8d8..2366c8d76 100644 --- a/gobject/gsignal.c +++ b/gobject/gsignal.c @@ -222,9 +222,9 @@ struct _Handler Handler *next; Handler *prev; GQuark detail; - guint ref_count; /* ABI change, was 16 bits but since it's internal... */ - guint block_count : 12; -#define HANDLER_MAX_BLOCK_COUNT (1 << 12) + guint ref_count; + guint block_count : 16; +#define HANDLER_MAX_BLOCK_COUNT (1 << 16) guint after : 1; GClosure *closure; }; @@ -454,17 +454,6 @@ handler_match_free1_R (HandlerMatch *node, return next; } -/* copy of gclosure.c code here to make the first 32 bits of the closure - * atomic. */ -typedef union -{ - GClosure bits; - gint atomic; -} GAtomicClosureBits; - -#define BITS_AS_INT(b) (((GAtomicClosureBits*)(b))->atomic) -#define CLOSURE_READ_BITS(cl,bits) (BITS_AS_INT(bits) = g_atomic_int_get ((gint*)(cl))) - static HandlerMatch* handlers_find (gpointer instance, GSignalMatchType mask, @@ -491,26 +480,20 @@ handlers_find (gpointer instance, } mask = ~mask; - for (handler = hlist ? hlist->handlers : NULL; handler; handler = handler->next) - { - GClosure bits; - - CLOSURE_READ_BITS (handler->closure, &bits); - - if (handler->sequential_number && - ((mask & G_SIGNAL_MATCH_DETAIL) || handler->detail == detail) && - ((mask & G_SIGNAL_MATCH_CLOSURE) || handler->closure == closure) && - ((mask & G_SIGNAL_MATCH_DATA) || handler->closure->data == data) && - ((mask & G_SIGNAL_MATCH_UNBLOCKED) || handler->block_count == 0) && - ((mask & G_SIGNAL_MATCH_FUNC) || (handler->closure->marshal == node->c_marshaller && - bits.meta_marshal == 0 && - ((GCClosure*) handler->closure)->callback == func))) - { - mlist = handler_match_prepend (mlist, handler, signal_id); - if (one_and_only) - return mlist; - } - } + for (handler = hlist ? hlist->handlers : NULL; handler; handler = handler->next) + if (handler->sequential_number && + ((mask & G_SIGNAL_MATCH_DETAIL) || handler->detail == detail) && + ((mask & G_SIGNAL_MATCH_CLOSURE) || handler->closure == closure) && + ((mask & G_SIGNAL_MATCH_DATA) || handler->closure->data == data) && + ((mask & G_SIGNAL_MATCH_UNBLOCKED) || handler->block_count == 0) && + ((mask & G_SIGNAL_MATCH_FUNC) || (handler->closure->marshal == node->c_marshaller && + handler->closure->meta_marshal == 0 && + ((GCClosure*) handler->closure)->callback == func))) + { + mlist = handler_match_prepend (mlist, handler, signal_id); + if (one_and_only) + return mlist; + } } else { @@ -535,25 +518,19 @@ handlers_find (gpointer instance, } for (handler = hlist->handlers; handler; handler = handler->next) - { - GClosure bits; - - CLOSURE_READ_BITS (handler->closure, &bits); - - if (handler->sequential_number && - ((mask & G_SIGNAL_MATCH_DETAIL) || handler->detail == detail) && - ((mask & G_SIGNAL_MATCH_CLOSURE) || handler->closure == closure) && - ((mask & G_SIGNAL_MATCH_DATA) || handler->closure->data == data) && - ((mask & G_SIGNAL_MATCH_UNBLOCKED) || handler->block_count == 0) && - ((mask & G_SIGNAL_MATCH_FUNC) || (handler->closure->marshal == node->c_marshaller && - bits.meta_marshal == 0 && - ((GCClosure*) handler->closure)->callback == func))) - { - mlist = handler_match_prepend (mlist, handler, hlist->signal_id); - if (one_and_only) - return mlist; - } - } + if (handler->sequential_number && + ((mask & G_SIGNAL_MATCH_DETAIL) || handler->detail == detail) && + ((mask & G_SIGNAL_MATCH_CLOSURE) || handler->closure == closure) && + ((mask & G_SIGNAL_MATCH_DATA) || handler->closure->data == data) && + ((mask & G_SIGNAL_MATCH_UNBLOCKED) || handler->block_count == 0) && + ((mask & G_SIGNAL_MATCH_FUNC) || (handler->closure->marshal == node->c_marshaller && + handler->closure->meta_marshal == 0 && + ((GCClosure*) handler->closure)->callback == func))) + { + mlist = handler_match_prepend (mlist, handler, hlist->signal_id); + if (one_and_only) + return mlist; + } } } } |