|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|
|Status:||Open||Last Modified:||2018-06-08 22:40:18|
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.