kevmcs has asked for the wisdom of the Perl Monks concerning the following question:

I would like to use cond_timedwait, but am limited to 5.8.0. So I am trying to write the equivalent but the threads silently die during cond_wait

Thread1- lock($signal); eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm 30; cond_wait($signal); alarm 0; }; if ($@) { print "timed out\n"; }else{ print "did not time out"; } Thread 2; cond_signal($signal);
If I substitute cond_timedwait($signal, time() + 30); for the alarm eval codeblock on 5.8.3 everything is well. Any help is much appreciated.

Best
Kevin