/* Copyright (c) 1993 Xerox Corporation. All rights reserved. */ /* $Id$ $Date$ * * PCR threads glue */ #ifndef __PCR_ThGlue_h #define __PCR_ThGlue_h 1 #include #include /* * The following boolean variables may be set externally to cause the * thread switcher to call the associated proc on the next thread * switch ... * - the argument is always NIL, * - all procs are called in sys critical sections, * - the procs may do (sticky) notifies, but may *not* block. * ( ?? June 28, 1992 ajd ?? ) * Client need not initialize the proc var before the associated boolean * var is set; if NIL it will not be called. * The proc should be prepared to be called even if the variable is not set. * It is the proc's responsibility to clear the variable. * The intended uses are described with the procs. */ PCR_Bool volatile PCR_ThGlue_doCheckIO; void (* volatile PCR_ThGlue_checkIO)(PCR_Any); /* A host file descriptor may have become ready for a requested I/O op. */ PCR_Bool volatile PCR_ThGlue_doCheckTimeout; void (* volatile PCR_ThGlue_checkTimeout)(PCR_Any); /* A clock tick occurred and could not be processed immediately */ PCR_Bool volatile PCR_ThGlue_doCheckChildren; void (* volatile PCR_ThGlue_checkChildren)(PCR_Any); /* SIGCHLD handling. */ PCR_Bool volatile PCR_ThGlue_doCollectSigs; void (* volatile PCR_ThGlue_collectSigs)(PCR_sigset_t * sigs); /* A host signal has arrived. The switcher calls collectSigs(s) to set *s to the set of traps that have arrived since the last call to collectSigs. External POSIX signals are handled by this mechanism without being returned here; see PCR_Sig_GetExternalInterrupts(). This mechanism delivers a trap to client code "immediately", *unless* the trap occurs in a critical section. Well, client code isn't supposed to be using critical sections, and the PCR implementation isn't supposed to generate traps, it says here ... The signal set is a PCR_sigset_t, *not* a host sigset_t -- i.e., signal numbers have already been translated. */ /* * Determine action associated with given signal */ void (* volatile PCR_ThGlue_getSigAction)( int sig, /* result */ PCR_Sig_Action * sa ); /* * The following is maintained by exclusive running threads */ PCR_Bool volatile PCR_ThGlue_runExclusive; PCR_Bool (* volatile PCR_ThGlue_checkRunExclusive)(PCR_Th_T *t); /* Return true iff t is allowed to run. */ #endif /* !__PCR_ThGlue_h */ /* $Log$ */