|
NetBurner 3.5.7
PDF Version |
RAII wrapper that spin-waits to claim a critical section. More...
#include <nbrtos.h>
Public Member Functions | |
| OSSpinCrit (OS_CRIT &ocrit) | |
| Construct the OSSpinCrit and spin until the critical section is claimed. | |
| ~OSSpinCrit () | |
| Destruct the OSSpinCrit and call Leave() on the OS_CRIT object. | |
RAII wrapper that spin-waits to claim a critical section.
Unlike OSCriticalSectionObj (which blocks the calling task), this class repeatedly calls EnterNoWait() on the OS_CRIT object until the section is successfully claimed. This allows the scheduler to continue running the task between attempts. On destruction, Leave() is called to release the critical section.
|
inline |
Construct the OSSpinCrit and spin until the critical section is claimed.
Repeatedly calls EnterNoWait() on the provided OS_CRIT object until it returns OS_NO_ERR, indicating successful ownership.
| ocrit | Reference to the OS_CRIT object to claim. |