<div dir="ltr">Why is the following error happening in the REPL?<div><br></div><div><div>> (define c (make-condition-variable))</div><div>> (define m (make-mutex))</div><div>> (mutex-unlock! m c)</div><div>*** ERROR IN ##thread-deadlock-action! -- Deadlock detected</div>
</div><div><br></div><div>If I do call mutex-unlock! from a thread, it does not raise this error:</div><div><br></div><div><div>> (thread-start! (make-thread (lambda () (mutex-unlock! m c) (println "ok"))))</div>
<div>#<thread #2></div><div>1> (condition-variable-broadcast! c)</div><div>=> ok</div></div><div><br></div><div>Is there a way to invoke mutex-unlock! from the top-level without raising the deadlock error?</div>
<div><br></div><div>Thanks,</div><div><br></div><div>--Vijay</div></div>