Pots::Semaphore - Perl ObjectThreads shared thread safe semaphore class


Pots documentation  | view source Contained in the Pots distribution.

Index


NAME

Top

Pots::Semaphore - Perl ObjectThreads shared thread safe semaphore class

SYNOPSIS

Top

    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();

DESCRIPTION

Top

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.

METHODS

Top

See Thread::Semaphore.

AUTHOR and COPYRIGHT

Top


Pots documentation  | view source Contained in the Pots distribution.