diff --git a/examples/threading/parameters.scm b/examples/threading/parameters.scm new file mode 100644 index 00000000..7221cae8 --- /dev/null +++ b/examples/threading/parameters.scm @@ -0,0 +1,25 @@ +;; A simple program demonstrating how parameter objects interact with threads +(import (scheme base) + (scheme read) + (scheme write) + (srfi 18) + ) + +(thread-start! + (make-thread + (lambda () + (thread-sleep! 1000) + (display "started thread, this should be written to console") + (newline) + (display "thread done") + (newline)))) + +(write `(1 2 3)) +(define fp (open-output-file "tmp.txt")) +(parameterize + ((current-output-port fp)) + (write `(4 5 6)) + (thread-sleep! 5000) +) +(close-port fp) +(write `(7 8 9))