Don't let just any event wake THREAD-JOIN.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 14 Nov 2014 04:47:04 +0000 (04:47 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Fri, 14 Nov 2014 04:47:04 +0000 (04:47 +0000)
tests/runtime/test-thread-queue.scm

index 6f86b7d575b698675ac38101726d86c8bf166345..186bb7e786edb4634f8356dedf674861310b01fb 100644 (file)
@@ -56,14 +56,15 @@ USA.
     (thread-join consumer)))
 
 (define (thread-join thread)
-  (let ((value))
+  (let ((done? #f) (value))
     (with-thread-events-blocked
      (lambda ()
        (join-thread thread (lambda (thread v)
                             (declare (ignore thread))
                             (set! value v)
+                            (set! done? #t)
                             #f))
-       (suspend-current-thread)
+       (do () (done?) (suspend-current-thread))
        value))))
 
 (define-test 'thread-queue