[perl #127865] Throwing a control exception within Lock.protect causes [LTA] locking behavior

2017-10-08 Thread Jan-Olof Hendig via RT
Seems to work fine, on my 32 bit VM, with 'This is Rakudo version 
2017.09-348-g830084430 built on MoarVM version 2017.09.1-575-gd4e230a69'



[perl #127865] Throwing a control exception within Lock.protect causes LTA locking behavior

2016-04-09 Thread via RT
# New Ticket Created by  Rob Hoelz 
# Please include the string:  [perl #127865]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=127865 >


If I have a control exception within a Lock.protect, the lock in question is 
still in a locked state after the call to protect returns.  On MoarVM, this has 
the side effect when a ReentrantMutex object gets collected, the underlying 
pthread_mutex is still locked.  pthread_mutex_destroy thus fails, and libuv 
calls abort().  To reproduce this, run the attached script, or follow these 
instructions:

$ git clone https://github.com/zostay/HTTP-Supply
$ git checkout ad7da71
$ perl6 -Ilib t/http-1.0.tuse v6;

for ^1_000_000 {
.say if $_ %% 1_000;

my $lock = Lock.new;

$lock.protect({
next;
});
}

say 'end';