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