Description: |
(text/x-fossil-wiki)
When the following script is evaluated in a core-8-branch build,
<code>threaderror</code> is called twice, once for the "worker" interpreter and
once for the "main" interpreter. If the variable name (<code>resvar<code> in
this example) is removed, there is only one call to <code>threaderror</code>.
In each case there should be only one call to an error handler.
<code>threaderrorcode</code>
<code><verbatim>
package require Thread
proc handle_result args {
puts [list {variable is changed} $args]
}
proc threaderror {tid msg} {
puts [list {thread error} $tid $msg]
}
proc main thread {
thread::send -async $thread {error {an error}} resvar
}
thread::errorproc threaderror
interp create t1
set thread [thread::create]
after 0 [list [namespace which main] $thread]
vwait forever
</verbatim></code>
|