#!/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