1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-06 11:32:29 +00:00

Simplify structure JanetThread and JanetChannel.

Remove JanetThreadShared.
This commit is contained in:
Calvin Rose
2019-12-04 21:04:43 -06:00
parent a1f35e21c7
commit de6c3d6d70
3 changed files with 76 additions and 95 deletions

View File

@@ -4,7 +4,7 @@
(def interval (:receive parent))
(for i 0 10
(os/sleep interval)
(printf "thread %s wakeup no. %d\n" name i))
(printf "thread %s wakeup no. %d" name i))
(:send parent :done))
(defn make-worker
@@ -16,7 +16,7 @@
(def bob (make-worker "bob" 0.2))
(def joe (make-worker "joe" 0.3))
(def sam (make-worker "joe" 0.5))
(def sam (make-worker "sam" 0.5))
# Receive out of order
(:receive bob)