Tcl Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Ticket UUID: 83116f5e05430902cdeb59758f6d53f57fafac3d
Title: Tcl_Async* documentation wrong
Type: Bug Version: 8.6 and later
Submitter: chw Created on: 2018-06-08 22:40:18
Subsystem: 69. Other Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2018-06-08 22:40:18
Resolution: None Closed By: nobody
    Closed on:
Description:

The Async.3 man page states "These procedures provide a safe mechanism for dealing with asynchronous events such as signals."

Signals here mean POSIX signals, i.e. software interrupts delivered by the kernel to a user process/thread.

The statement in the man page is wrong, when the Tcl core is built with TCL_THREADS w.r.t. the function Tcl_AsyncMark(), which needs to acquire at least one mutex using the POSIX function pthread_mutex_lock(), which is not allowed in a signal context.

OTOH, the statement is correct, when the Tcl core is single threaded, since no potentially blocking system call is involved, but a single flag is set.

Thus, additional wording is required, to describe more precisely the working of Tcl_AsyncMark() et.al. in threaded and non-threaded environments.