Pots::Semaphore - Perl ObjectThreads shared thread safe semaphore class
use threads; use Pots::Semaphore; my $s = Pots::Semaphore->new(0); sub thread_proc { print "Thread waiting for semaphore.\n"; $s->down(); print "Thread got semaphore.\n"; } my $th = threads->new("thread_proc"); sleep(5); $s->up();
This class is a direct revamp of the standard Perl Thread::Semaphore. It only exists because, for a yet unknown reason, I was unable to store standard Thread::Semaphore objects in shared accessors. Once this is worked out, this class will surely disappear.
Thread::Semaphore
See Thread::Semaphore.
Remy Chibois <rchibois at free.fr>
Copyright (c) 2004 Remy Chibois. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Pots::Thread, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pots::Thread
CPAN shell
perl -MCPAN -e shell install Pots::Thread
For more information on module installation, please visit the detailed CPAN module installation guide.