#: 21286 S5/OS9 Users Group
04-Dec-95 15:52:01
Sb: #21284-Lost signals
Fm: Ian J Shearer 100410,2733
To: Ian Langmead 71307,1417 (X)
Ian
It's easy to think you're losing signals when it's not actually happening.
There are a few things to watch out for.
1. Signals are guaranteed not lost from one task to the signal handler of
another. If you set a flag in the handler which is then checked in the main
code (i.e. the standard approach) you might not check the flag soon enough. The
answer is to use _os_sigmask() to queue new signals until the old one is dealt
with.
2. If you're using events, then be aware that waiting on an event unmasks
signals just the same as sleeping does. Check the return value to see that the
event has actually done what you think and that you haven't been woken by a
signal.
3. The same goes for when you're waiting for a child process to die.
Hope this helps.
-Ian J Shearer, Onyx Systems Ltd.
|