/* Copyright (c) 1993 Xerox Corporation. All rights reserved. */ /* $Id$ $Date$ * * PCR Threads Critical Section support. * */ #ifndef __PCR_ThCrSec_h #define __PCR_ThCrSec_h 1 #include #define PCR_ThCrSec_DEBUG 1 #if PCR_ThCrSec_DEBUG extern void PCR_ThCrSec_Oops(); #endif /* * Lib critical sections (for calling async-unsafe procedures): * * Sig handlers are not invoked. * No preemption occurs. * Voluntary thread switching is allowed. * Multiple processors may be in lib critical sections * concurrently. * * * Sys critical sections (system implementation use only): * * Sig handlers are not invoked. * No preemption occurs. * Voluntary thread switching is allowed. * Mutual exclusion between processors. * */ /* * CrSec procs */ extern void PCR_ThCrSec_EnterSys(void); /* Enter a critical section. */ extern void PCR_ThCrSec_ExitSys(void); /* Leave a sys critical section, and if not nested do any deferred actions. */ extern PCR_Bool PCR_ThCrSec_InSysCrSec(void); /* Test whether currently in a critical section. */ extern PCR_Bool PCR_ThCrSec_InSysCrSecs(void); /* Test whether in a nested critical section. */ /* * Lib CrSec procs -- analogous to sys CrSec procs */ extern void PCR_ThCrSec_EnterLib(void); extern void PCR_ThCrSec_ExitLib(void); extern PCR_Bool PCR_ThCrSec_InLibCrSec(void); extern PCR_Bool PCR_ThCrSec_InLibCrSecs(void); /* * Common stuff to record arrival of signals * in critical sections where preemption is disabled ... */ extern void PCR_ThCrSec_MustCheckSigs(void); /* Arrange to check for arrival of signals the next time we leave a sys or lib critical section. */ extern void PCR_ThCrSec_MustYield(void); /* Arrange for a reschedule (preemption) the next time we leave a sys critical section. */ /* * Inline all this stuff ... */ #if !defined(__PCR_ThCrSecInlines_h) && !defined(PCR_ThCrSec_NINLINES) # include #endif #endif /* ! __PCR_ThCrSec_h */ /* $Log$ */