incorrect use of thread conditions leads to race conditions
joblist_queue_thread uses g_cond_wait incorrectly. The mutex must be locked before the call; otherwise, it does nothing and the mutex is never locked. This may not be tripping errors because slower error-checking mutexes aren't being used; having debug builds compile with G_ERRORCHECK_MUTEXES enabled may help expose problems like this (havn't tested).
This fixes problems with connections getting stuck in an inconsistent state, with in_joblist set but not actually in either joblist, effectively leaking the connection and its fds permanently.
Also available in: Atom