Simon Geard <
si...@whiteowl.co.uk> wrote:
> proc ex_run {} {
> puts "Exiting"
> }
>
> proc st_run {} {
> puts "Starting"
> }
>
> # The following fails even though st_run is defined
> set tp [tpool::create -initcmd st_run -exitcmd ex_run]
Read the -initcmd and -exitcmd part of the tpool manpage carefully:
-initcmd script
Sets a Tcl script used to initialize new worker thread.
-exitcmd script
Sets a Tcl script run when the idle worker thread exits.
Then note that your -initcmd and -exitcmd arguments are "proc names"
not "scripts".