Fix a bug with signaling a thread that waits for condvar
* src/thread.c (lisp_mutex_lock_for_thread): New function, with all the guts of lisp_mutex_lock. (lisp_mutex_lock): Call lisp_mutex_lock_for_thread. (condition_wait_callback): Don't call post_acquire_global_lock before locking the mutex, as that could cause a signaled thread to exit prematurely, because the condvar's mutex is recorded to be not owned by any thread, and with-mutex wants to unlock it as part of unwinding the stack in response to the signal.
Showing with 24 additions and 17 deletions