in reply to synchronized sub-routine call
Oh, but if you want the previous function to continue running, and then time out, look at signal handlers: $SIG{ALRM}
See perlipc. Here's an example:
eval { local $SIG{ALRM} = sub { die "alarm clock restart" }; alarm 10; flock(FH, 2); # blocking write lock alarm 0; }; if ($@ and $@ !~ /alarm clock restart/) { die }
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: synchronized sub-routine call
by waswas-fng (Curate) on Jul 26, 2004 at 17:01 UTC | |
|
Re^2: synchronized sub-routine call
by b4e (Sexton) on Jul 26, 2004 at 18:21 UTC |