diff options
author | dgp <dgp@users.sourceforge.net> | 2011-09-12 05:06:11 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-09-12 05:06:11 (GMT) |
commit | 021b7b35eb1380f04f55ca09121e9a392a1bd1ee (patch) | |
tree | ac88dac09607fde5225077f6b81538dfcde57386 | |
parent | f17890321842cedc4b3d1ee105278a56b75d2704 (diff) | |
download | tcl-021b7b35eb1380f04f55ca09121e9a392a1bd1ee.zip tcl-021b7b35eb1380f04f55ca09121e9a392a1bd1ee.tar.gz tcl-021b7b35eb1380f04f55ca09121e9a392a1bd1ee.tar.bz2 |
more conversion work
-rw-r--r-- | tests/thread.test | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/tests/thread.test b/tests/thread.test index 7bc7394..6cd4b5d 100644 --- a/tests/thread.test +++ b/tests/thread.test @@ -200,29 +200,24 @@ test thread-4.5 {TclThreadSend preserve errorCode} {thread} { } {1 ERR CODE} -test thread-5.0 {Joining threads} {testthread} { - threadReap - set serverthread [testthread create -joinable] - testthread send -async $serverthread {after 1000 ; testthread exit} - set res [testthread join $serverthread] - threadReap - set res +test thread-5.0 {Joining threads} {thread} { + set serverthread [thread::create -joinable -preserved] + thread::send -async $serverthread {after 1000 ; thread::release} + thread::join $serverthread } {0} -test thread-5.1 {Joining threads after the fact} {testthread} { - threadReap - set serverthread [testthread create -joinable] - testthread send -async $serverthread {testthread exit} +test thread-5.1 {Joining threads after the fact} {thread} { + set serverthread [thread::create -joinable -preserved] + thread::send -async $serverthread {thread::release} after 2000 - set res [testthread join $serverthread] - threadReap - set res + thread::join $serverthread } {0} -test thread-5.2 {Try to join a detached thread} {testthread} { - threadReap - set serverthread [testthread create] - testthread send -async $serverthread {after 1000 ; testthread exit} - catch {set res [testthread join $serverthread]} msg - threadReap +test thread-5.2 {Try to join a detached thread} {thread} { + set serverthread [thread::create -preserved] + thread::send -async $serverthread {after 1000 ; thread::release} + catch {set res [thread::join $serverthread]} msg + while {[llength [thread::names]] > 1} { + after 20 + } lrange $msg 0 2 } {cannot join thread} |