Created
November 11, 2016 18:17
-
-
Save bovine/6215d99c24d5b199c79bef9a2eb3b300 to your computer and use it in GitHub Desktop.
tpool::release hangs if any of the thread pool's workers have exited
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
tpool::post $mypool "puts \"hello\"; thread::exit" | |
puts "releasing pool (this hangs)" | |
tpool::release $mypool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
admittedly, using thread::exit within a tpool is not a normal or recommended activity, but maybe this should be handled and detected better.