Skip to content

Instantly share code, notes, and snippets.

@shirok
Created December 12, 2011 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shirok/1464566 to your computer and use it in GitHub Desktop.
Save shirok/1464566 to your computer and use it in GitHub Desktop.
diff --git a/test/control.scm b/test/control.scm
index 4631c41..69e9d46 100644
--- a/test/control.scm
+++ b/test/control.scm
@@ -49,9 +49,12 @@
(cond-expand
[gauche.sys.pthreads
(test* "job-wait, job-kill" '(killed foo)
- (let* ([job (make-job (^[] (sys-sleep 10)) :waitable #t)]
+ (let* ([gate (make-mtqueue :max-length 0)]
+ [job (make-job (^[] (enqueue/wait! gate #t) (sys-sleep 10))
+ :waitable #t)]
[t1 (thread-start! (make-thread (^[] (job-run! job))))]
[t2 (thread-start! (make-thread (^[] (job-wait job))))])
+ (dequeue/wait! gate)
(job-mark-killed! job 'foo)
(list (thread-join! t2) (job-result job))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment