Artifact
1698a21658349bb049cec8a1eb745a4c3ec1e6d3:
Attachment "tpool_threxit_bug2.tcl" to
ticket [646509f34f]
added by
bovine
2016-11-11 23:17:43.
#!/usr/local/bin/tclsh
package require Thread
# initialize the thread pool
set mypool [tpool::create -minworkers 1 -maxworkers 5]
# queue up something that exits the thread.
# this will be unable to process more than 5 events because all of the workers have gone away.
for {set i 0} {$i < 10} {incr i} {
tpool::post $mypool "puts \"hello $i\"; thread::exit"
}
tpool::release $mypool