GNOME Bugzilla – Bug 322537
Deadlocks in inotify_monitor_add() when using threads
Last modified: 2005-12-01 19:07:04 UTC
inotify_monitor_add() sometimes calls itself recursively while holding the intify_monitor_lock. Thus, it deadlocks. Without calling g_thread_init(NULL), the G_LOCK call does nothing. That's why we only see the problem after calling g_thread_init(NULL).
oh how I wish we had reentrant locks in glib. thinking about how to fix this. suggestions welcome but as far as i can see there are 2 real possibilities: 1) create reentrant locks for ourselves 2) have a "don't lock" bit in the 'flag' field that gets set when libinotify calls itself
We _do_ have these locks in glib. I just didn't know about them. Using them now. Thanks for the report.