threads::shared: veto signal despatch if locked
authorDavid Mitchell <davem@iabyn.com>
Fri, 4 Jun 2010 16:05:21 +0000 (17:05 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 4 Jun 2010 16:05:21 +0000 (17:05 +0100)
commit65c7421c80585e0d12a20773935dc01f4ffa3e42
treeb136c08b8c0bb3d7d4da49a66655171d338f20a6
parent92f022bbf8c129c6f2379a382f1eaaa5c7bd9f3f
threads::shared: veto signal despatch if locked

This fixes RT #74868: Safe signals changes causing hangs with threads.

The basic issue is that due to changes in where safe signals can be
despatched, (including now on leaving scope), it's possible for a
perl-level signal handler to be called while PL_sharedsv_lock is held.
If the handler does locking or manipulation of shared vars, then deadlock
can occur.

A robust fix for this is to ensure that the signal handler isn't called
while we have the lock. This is done using the signal handler hook added
in the previous commit.
dist/threads-shared/shared.xs