Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e57ea2a03eb07362976e1ca595ae3246be7f8694
Ticket: f4f44174e4c88a9132b19bcc4b68346a1d229fe1
protect notifier against signals
User & Date: chw on 2016-12-07 01:42:06
Changes

  1. icomment:
    Oooooops. That's definitely a deadlock since the signal handling tries to lock the same mutex path as Tcl_AsyncInvoke() since the signal is received by the same thread. Looks like a fundamental design problem. In the olden unthreaden threatless days where Tcl_MutexLock(), Tcl_MutexUnlock(), and the alert function were dummies, this was no problem at all since the flag for async invoke was simply set by the signal handler. Nowadays the signal handler likes to acquire and release a mutex. And POSIX does not list pthread_mutex_(unlock|lock)() as async signal safe functions. BUMMER! Signals and threads are two-component explosive by committee design, now I wonder what Angus McGyver would do.
    
  2. login: "chw"
  3. mimetype: "text/plain"