mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-03 19:26:34 +02:00
New file
This commit is contained in:
parent
f2545f5ae2
commit
45c3d05369
1 changed files with 25 additions and 0 deletions
25
examples/threading/parameters.scm
Normal file
25
examples/threading/parameters.scm
Normal file
|
@ -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))
|
Loading…
Add table
Reference in a new issue