in reply to Mutex::Flock - Fcntl advisory locking supporting processes and threads.

Greetings,

I found time to complete this including releasing 1.002 on CPAN.

In the future, I will remove MCE::Mutex from MCE and have it depend on the new Mutex module. Regarding MCE::Shared, eventually that will no longer depend on MCE now that Mutex is a separate module.

Currently, there are two implementations. The default is "Channel" when "impl" is not given.

use strict; use warnings; use Mutex; my $m1 = Mutex->new( ); my $m2 = Mutex->new( path => /tmp/my.lock ); my $m3 = Mutex->new( impl => "Channel" ); my $m4 = Mutex->new( impl => "Flock" ); $m1->impl(); # Channel $m2->impl(); # Flock $m3->impl(); # Channel $m4->impl(); # Flock $m1->lock; $m1->unlock; $m2->lock_exclusive; # Fcntl LOCK_EX $m2->lock # ditto LOCK_EX $m2->lock_shared; # Fcntl LOCK_SH $m2->unlock; # Fcntl LOCK_UN

Regards, Mario

Edit: Updated the CPAN link to point to the 1.001 release.
Edit: Updated link to the 1.002 release.

  • Comment on Re: Mutex::Flock - Fcntl advisory locking supporting processes and threads.
  • Download Code