Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-12-01
23:30 • Ticket [3439599fff] thread::cancel not reporting error status still Open wit... artifact: d8a679227a user: dgp
2011-11-18
06:22 • Ticket [3439599fff]: 4 changes artifact: 872d47094a user: mistachkin
2011-11-17
21:37 • New ticket [3439599fff]. artifact: 4c3acc0e47 user: dgp

thread::cancel not reporting error

Open3439599fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-11-17 21:37:38
$ cat demo2.tcl
package require Thread 2.7

set ::bar "NO ERROR THROWN"
proc ::foo {id info} {
    set ::bar "Thread $id stack:\n$info"
}
thread::errorproc ::foo

set one [thread::create -joinable {while 1 {}}]
thread::cancel $one
thread::join $one
puts stderr "SAVED ERROR: $::bar"


$ make shell SCRIPT=demo2.tcl
...
SAVED ERROR: NO ERROR THROWN
mistachkinplain2011-11-18 06:22:24
From the code snippet you included above, it seems like you are expecting to have the sending interpreter receive an error when it cancels the interpreter in the other thread?  The sending interpreter does not encounter any error condition by canceling the other thread and the fact that your script completes indicates that the target (receiving) thread is being canceled properly.
dgpplain2011-12-01 23:30:23
I thought a cancellation got converted into
a (un-[catch]able?) TCL_ERROR status unwinding
up through the call stack in the cancelled thread?
Is the issue really with [thread::create] maybe?
Not (yet) in an event loop, so don't have thread::errorproc
handling engaged?
Log in (anonymous is fine) to add a comment.