notify_lock taken three times in GObject::notify; racy
In g_object_notify_by_spec_internal()
, the notify_lock
is taken and released three times in the nqueue != NULL
code path, once by each of g_object_notify_queue_freeze()
, g_object_notify_queue_add()
and g_object_notify_queue_thaw()
. It’s possible that another thread could emit GObject::notify
, or freeze/thaw the notify queue, between those locks being held, and hence mess up the emissions.
The locks should be combined and a unit test added (if a relevant one doesn’t exist already).