The code you posted works for me. I changed each system call to "system 'sleep 30'", and I commented out the &killhung calls. Otherwise it's the same code. It prints out both alarm messages, and it finishes in 20 seconds.
This reminds me of How to timeout if a call to an external program takes too long, so maybe that thread will help. If what you posted is a simplified version of what you're doing, maybe the details you left out explain the problem. See, for example, Re^9: How to timeout if a call to an external program takes too long, where an open file handle causes the program to hang even though the alarm has triggered.
In reply to Re: eval and alarm
by kyle
in thread eval and alarm
by Earindil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |