signal handler in the sleeping thread, because some operating systems
deliver the SIGINT to that thread rather than the signalling thread.
p4raw-id: //depot/perl@28174
# Thread sleeps until signalled
ok(1, 'Thread sleeping');
- sleep(5);
+ {
+ local $SIG{'INT'} = sub {};
+ sleep(5);
+ }
# Should not go past here
ok(0, 'Thread terminated normally');
return ('ERROR');
# Interrupt thread's sleep call
{
+ # We can't be sure whether the signal itself will get delivered to this
+ # thread or the sleeping thread
local $SIG{'INT'} = sub {};
ok(kill('INT', $$) || $^O eq 'MSWin32', q/Interrupt thread's sleep call/);
}