13#ifndef __CRITICALSECTIONBLOCK_H
14#define __CRITICALSECTIONBLOCK_H
131#define synchronized(cs) for(CriticalSectionBlock __currentlocked(cs);__currentlocked.checkonce();)
A CriticalSectionBlock locks a critical section for the lifetime of the CriticalSectionBlock.
bool checkonce()
don't use.
CriticalSectionBlock(critsec_t *critsec)
Constructor locks the critical section.
~CriticalSectionBlock()
destructor automatically unlocks the critical section.
char _checkonceHackCounter
little hack, to make it possible to implement the synchronized() macro with the for(;;) loop below.
int enter_critical_section(critsec_t *cs)
lock a critical section, or wait until it is available.
#define leave_critical_section(cs)
leave critical section
critical section data structure