in reply to Non-Blocking Semaphore
# untested with your particular situation, but should be a guide. eval { local $SIG{ALRM} = sub { die "lock\n" }; # NB: \n required alarm 5; flock(LOCK, LOCK_EX | LOCK_NB); alarm 0; }; if ($@) { die unless $@ eq "lock\n"; } else { # keep going }
Cheers,
KM
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Non-Blocking Semaphore
by maverick (Curate) on Aug 26, 2000 at 03:52 UTC | |
by tilly (Archbishop) on Aug 26, 2000 at 09:59 UTC |