Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package require Thread
- proc tfunc {i} {
- if {$i == 0} {
- return
- }
- puts "[thread::id] $i"
- # this won't work
- set t [thread::create -joinable]
- thread::send -async $t [list tfunc [incr i -1]]
- thread::join $t
- }
- tfunc 10
Add Comment
Please, Sign In to add comment