I have the following snippet in a single file scsh script with a main
entry function which spawns two threads then going asleep. The two
threads calling the following lock-set and lock-get functions. But it
seems I get only strange results.
That, the lock-get function always returns #t no matter what been set
in another thread using lock-set.
(define eyes-working #t)
(define (lock-set-eyes-working val)
(set! eyes-working val)
(debug-newline (if eyes-working
"Eyes not working!")))
(let ((ret eyes-working))
(debug-newline (if ret
"Get eyes working!"
"Get eyes not working!"))
Please help me understand it! Thank you!
Another question is that, I can't seem to be able to understand the
necessity of the placeholders functions given the availability of the
locks functions. Can you please tell me the rationality behind it?