On EC2+ubuntu jaunty+mzscheme 4.2.4/4.1.3 this dies with an error 4 out of 5 times. Every now and then enq seems to reset the queue's tail pointer.
(= q (queue))
; The contract for queues: q.1 is reachable from q.0
(unless (reclist [is _ q.1] q.0)
(enq 0 q))
(until (is 0 qlen.q)
No error in snow leopard with mzscheme 4.2.2. Could y'all try it out on platform/version combos you have access to, and post the results?
Relevant is this comment above the implementation of enq:
; Despite call to atomic, once had some sign this wasn't thread-safe.
; Keep an eye on it.