deprecated threads: fix race in GStaticRecMutex
authorMark Janossy <janossy.mark@gmail.com>
Fri, 9 Mar 2012 14:54:23 +0000 (09:54 -0500)
committerRyan Lortie <desrt@desrt.ca>
Fri, 9 Mar 2012 14:54:23 +0000 (09:54 -0500)
commit265f265c677bc5399dbb1cfa449cb4b915a6459f
treeb80cfbe6696638faa8e00b478363ca070cc0d1f5
parentcb44e96dfadf33c1c5df43dabe7ced19a03789dc
deprecated threads: fix race in GStaticRecMutex

The very last access to the 'depth' field of GStaticRecMutex in
g_static_rec_mutex_unlock_full() was being performed after dropping the
implementation mutex for the last time.

This allowed the lock to be dropped an additional time if it was
acquired in another thread right at that instant (which is somewhat
likely, since another thread could have just been woken up by the lock
being released).

https://bugzilla.gnome.org/show_bug.cgi?id=670846
glib/deprecated/gthread-deprecated.c