Tcl Source Code

View Ticket
Login
Ticket UUID: 0be26484a0743c05cb7e04c8d4caf62bbc6a99c3
Title: mutex in TclpFinalizeNotifier in the epoll and kqueue notifiers
Type: Bug Created on: 2026-05-25 14:06:55
Submitter: anonymous Assigned to: nobody
Subsystem: 02. Event Loops Severity: Important
Priority: 5 Medium Last modified: 2026-05-25 14:06:55
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: Tcl 9.1a2
Description:

The notifier in unix/tclEpollNotfy.c has a notifierMutex in its ThreadSpecificData. The comment says that this mutex protects notifier termination in TclpFinalizeNotifier. In TclpFinalizeNotifier, indeed the code is protected by

    pthread_mutex_lock(&tsdPtr->notifierMutex);
    ...
    pthread_mutex_unlock(&tsdPtr->notifierMutex);

However, since notifierMutex is not acquired in TclpAlertNotifier or anywhere else (if NOTIFIER_EPOLL is defined), the mutex does not seem to be doing anything useful. This may be a vestige of the select-based notifier, which does acquire notifierMutex in TclpAlertNotifier.

The same issue occurs in the kqueue notifier.