Re: locking bug in glib:g_main_context_iterate()



Matthias,

in g_main_context_iterate(), the function can be left with the
context unlocked in some cases. This leads to double unlocking
of mutexes which might lead to diagnostic printouts or program
aborts, depending on the thread library.
The appended patch fixes it for me. (It only considers the
G_THREADS_ENABLED case; one might rearrange things slightly
for sanity.)

I agree, this looks fishy. The "funny" thing is, that this has been in
almost unchanged since SVN revision 1291 from 2001-06-30. Maybe only
the forgiveness of the usual thread implementations have saved our ass
here.

Seems scary to change that now, but we probably should. Or there is
something very simple, I just overlook....

/ Sebastian
--
Sebastian Wilhelmi
wilhelmi google com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]