home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <sys/types.h>
-
- #undef integer /* Silly stdtypes */
- #include "Kernel/h/stdTypes.h"
- #include "Kernel/h/kEvents.h"
- #include "Kernel/h/kmdTypes.h"
-
- #ifndef xkernel
- /*
- * ReleaseSigs1
- *
- * Releases signals held by HoldSigs. If a signal came in while the
- * signals were being held, the handler will be called at this point.
- * ReleaseSigs1 is called by the ReleaseSigs macro only when some signal
- * is pending.
- */
-
- void ReleaseSigs1()
- {
- int i, p;
-
- if (!SigsHeld) {
- ErrMsg("Call to ReleaseSigs1 with signals not held\n");
- HoldSigs();
- }
-
- do {
- DebugMsg(5, "Releasing signals. %s\n",
- Pending ? "Signals pending" : "None pending (?)");
- Pending = 0; /* A signal arriving here has either caused
- SigTable[sig].NTimes > 0 or Pending=1.
- so either it is processed by the inner loop
- or it causes the outer loop to repeat. */
-
- for (i=0, p=ActSig[0]; i < ActCount; i++, p=ActSig[i]) {
- while ( SigTable[p].Ntimes > 0 ) {
- DebugMsg(5, " Calling handler for signal %d\n", p);
- SigTable[p].Ntimes--;
- (SigTable[p].Handler)(i);
- }
- }
- } while ( SigsHeld = Pending); /* Assignment MUST be performed
- atomically: Check generated code! */
- }
- #endif
-