13 #ifndef __CRITICALSECTIONBLOCK_H
14 #define __CRITICALSECTIONBLOCK_H
77 char _checkonceHackCounter;
85 _checkonceHackCounter(1)
93 inline bool checkonce() {
return _checkonceHackCounter-- > 0; }
131 #define synchronized(cs) for(CriticalSectionBlock __currentlocked(cs);__currentlocked.checkonce();)
struct critsec critsec_t
critical section type definition
~CriticalSectionBlock()
destructor automatically unlocks the critical section.
#define leave_critical_section(cs)
leave critical section
CriticalSectionBlock(critsec_t *critsec)
Constructor locks the critical section.
bool checkonce()
don't use.
A CriticalSectionBlock locks a critical section for the lifetime of the CriticalSectionBlock.
int enter_critical_section(critsec_t *cs)
enter critical section
Interface: critical section management.