Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
g_cond_wait() and the likes unlock the passed in mutex during the wait and re-lock it before returning. However, the code here used to pass in an unlocked mutex. This used to work because GLib threading implementation was tolerant and allowed unlocking an unlocked mutex, but GLib 2.42 has a new and less tolerant implementation that would abort in such situation. Fix this by properly locking the passed in mutex. The implementation here also removes the second mutex only used for the condition as the one used to protect the loop body can very well be used and actually makes sense as they protect the same thing. Doing so requires to properly wait for the thread to quit before destroying the mutex, but this probably should be done anyways to avoid forcefully killing the thread when the application quits.
- Loading branch information