• Eli Zaretskii's avatar
    Fix a bug with signaling a thread that waits for condvar · 5fefaaa8
    Eli Zaretskii authored
    * 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.
    5fefaaa8
thread.c 27.3 KB