Tcl Source Code

Artifact [703fba1344]
Login

Artifact 703fba13446430d84b1b17a5544f44b5765fbfa7:

Attachment "getErrorBug.tcl" to ticket [3534607fff] added by tomkiti 2012-06-12 21:30:50.
# Create a thread pool and post a job that throws an error.
package require Thread
set tpool [tpool::create]
set job [tpool::post $tpool {error 123}]

# Get the result.
tpool::wait $tpool $job
catch {tpool::get $tpool $job} result
puts "result = $result"
puts "errorInfo = $errorInfo" ;# BUG: Result displayed twice
puts "errorCode = $errorCode"

# Wait for pool to terminate, otherwise receive error:
# "called Tcl_FindHashEntry on deleted table".
tpool::release $tpool
after 1 {set forever 1}
vwait forever


# Output:
#
# result = 123
# errorInfo = 123123
#     while executing
# "error 123"
#     invoked from within
# "tpool::get $tpool $job"
# errorCode = NONE