Thread-Semaphore

Thread::Semaphore(3p) Perl Programmers Reference Guide Thread::Semaphore(3p)

Thread-Semaphore

Thread::Semaphore(3p) Perl Programmers Reference Guide Thread::Semaphore(3p) # Thread::Semaphore(3p) Perl Programmers Reference Guide Thread::Semaphore(3p) NNAAMMEE # Thread::Semaphore - Thread-safe semaphores VVEERRSSIIOONN # This document describes Thread::Semaphore version 2.13 SSYYNNOOPPSSIISS # use Thread::Semaphore; my $s = Thread::Semaphore->new(); $s->down(); # Also known as the semaphore P operation. # The guarded section is here $s->up(); # Also known as the semaphore V operation. # Decrement the semaphore only if it would immediately succeed. if ($s->down_nb()) { # The guarded section is here $s->up(); } # Forcefully decrement the semaphore even if its count goes below 0. ...