~ chicken-core (chicken-5) 5d4740db6d88371bd774c393b750d5588ac9ee08
commit 5d4740db6d88371bd774c393b750d5588ac9ee08 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Thu Sep 16 09:02:40 2010 -0400 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Thu Sep 16 09:02:40 2010 -0400 added simple threading test diff --git a/tests/srfi-18-tests.scm b/tests/mutex-test.scm similarity index 98% rename from tests/srfi-18-tests.scm rename to tests/mutex-test.scm index de38727c..8962a1ec 100644 --- a/tests/srfi-18-tests.scm +++ b/tests/mutex-test.scm @@ -1,3 +1,6 @@ +;;;; mutex-test.scm + + (require-extension srfi-18) (cond-expand (dribble diff --git a/tests/runtests.sh b/tests/runtests.sh index e2c2eab6..d7f9fce0 100644 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -212,7 +212,8 @@ echo "======================================== srfi-4 tests ..." $interpret -s srfi-4-tests.scm echo "======================================== srfi-18 tests ..." -$interpret -s srfi-18-tests.scm +$interpret -s simple-thread-test.scm +$interpret -s mutex-test.scm echo "======================================== path tests ..." $interpret -bnq path-tests.scm diff --git a/tests/simple-thread-test.scm b/tests/simple-thread-test.scm new file mode 100644 index 00000000..0e77eb52 --- /dev/null +++ b/tests/simple-thread-test.scm @@ -0,0 +1,19 @@ +;;;; simple-thread-test.scm + + +(use srfi-18 extras) + + +(define (spin) + (do ((i 0 (add1 i))) + ((>= i 10)) + (print (current-thread) " sleeps ...") + (thread-sleep! (random 3))) + (print (current-thread) " finished.")) + +(thread-start! spin) +(thread-start! spin) +(spin) +(print (current-thread) " waits ...") +(thread-sleep! 3) +(print "end.")Trap