Tcl Source Code

View Ticket
Login
Ticket UUID: 3407860
Title: thread::exit flaws
Type: Bug Created on: 2011-09-11 20:50:07
Submitter: dgp Assigned to: vasiljevic
Subsystem: 80. Thread Package Severity:
Priority: 5 Medium Last modified: 2026-10-22 17:19:29
Status: Closed Closed by: serhiy.storchaka
Resolution: Fixed Closed on: 2026-10-21 09:59:44
Version: None
Description:
Perhaps there's no value fixing a command that's
marked deprecated, but...

[thread::exit] is documented to take no arguments,
but that's not checked.  Any number of arguments
are accepted and ignored without error.

It would seem to be more valuable, both in utility
and in parallel behavior with [::exit] for the command
[thread::exit] to accept one optional argument, an
integer "exit code" for the thread.

Without such an argument [thread::exit] always
declares the thread exit code to be 666, and
[thread::join] returns that value as documented,
when it is used.  But what value is that?  Returning
a value that never changes?
User Comments:
mistachkin added on 2011-11-21 14:19:37:
After careful review of the thread package code, I agree that this command should be changed in the way described by dgp.

serhiy.storchaka added on 2026-10-21 09:59:44:

Fixed in Thread 2.8.0 by 0839286864: thread::exit now accepts an optional exit status (default 666), which thread::join returns, and rejects extra arguments.