|
When tclsh forks it can create new threads in the child process, in a
pthread_atfork() handler. Running this under pseudo results in a
deadlock since the pseudo_lock() call in the new thread in the child
process premanently believes that the mutex is already locked by another
thread (which actually only existed in the parent process).
The provided test cases reproduces this. Similar hangs can also been
seen in other cases, such as when attempting to use vim's cscope support
under pseudo.
Fix it by reseting the mutex in a pthread_atfork() child function.
Signed-off-by: Rabin Vincent <rabinv@axis.com>
Signed-off-by: Seebs <seebs@seebs.net>
|