JackHammer has asked for the wisdom of the Perl Monks concerning the following question:
sub Sem_P { my $x; open(LOCK, ">$lockfile"); #Attempt to get a lock for($x = 0; ($x = $Lock_Tries) && !flock(LOCK, LOCK_EX | LOCK_ +NB); $x++) { #Sleep using select for a granularity #of less than 1 second select(undef, undef, undef, $Lock_Timeout); } return ($x =< $Lock_Tries); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Non-Blocking Semaphore
by KM (Priest) on Aug 25, 2000 at 23:11 UTC | |
by maverick (Curate) on Aug 26, 2000 at 03:52 UTC | |
by tilly (Archbishop) on Aug 26, 2000 at 09:59 UTC | |
|
RE (tilly) 1: Non-Blocking Semaphore
by tilly (Archbishop) on Aug 25, 2000 at 23:31 UTC |