NetBurner 3.5.7
PDF Version
OSLockAndCritObj Class Reference

RAII wrapper that combines an OS task lock with an OS_CRIT critical section. More...

#include <nbrtos.h>

Public Member Functions

 OSLockAndCritObj (OS_CRIT &ocrit)
 Construct the object, lock the OS, and enter the critical section.
 
 ~OSLockAndCritObj ()
 Destruct the object, leave the critical section, and unlock the OS.
 

Detailed Description

RAII wrapper that combines an OS task lock with an OS_CRIT critical section.

On construction, calls LockAndEnter() on the provided OS_CRIT object, which prevents task switching and claims the critical section. On destruction, calls LeaveAndUnlock() to release both the critical section and the task lock.

See also
OS_CRIT::LockAndEnter(), OS_CRIT::LeaveAndUnlock(), OSCriticalSectionObj, OSLockObj

Constructor & Destructor Documentation

◆ OSLockAndCritObj()

OSLockAndCritObj::OSLockAndCritObj ( OS_CRIT & ocrit)
inline

Construct the object, lock the OS, and enter the critical section.

Calls LockAndEnter(0) on the provided OS_CRIT object, waiting indefinitely until the critical section is claimed.

Parameters
ocritReference to the OS_CRIT object to lock and enter.

The documentation for this class was generated from the following file: