7 use Thread::Cleanup::TestThreads;
15 sub msg { lock @stack; push @stack, join ':', @_ }
17 Thread::Cleanup::register {
24 local $SIG{__DIE__} = sub { msg 'sig', @_ };
25 no warnings 'threads';
34 plan skip_all => 'Could not spawn the testing thread';
43 is shift(@stack), 'spawn';
44 like shift(@stack), qr/sig:thread at \Q$0\E line \d+/;
45 is shift(@stack), 'cleanup';
46 like shift(@stack), qr/sig:cleanup at \Q$0\E line \d+/;
47 is shift(@stack), 'done';
48 is_deeply \@stack, [ ], 'nothing more';