|
NetBurner 3.5.7
PDF Version |
RAII wrapper for OSLock()/OSUnlock() that prevents task switching within a scope. More...
#include <nbrtos.h>
Public Member Functions | |
| OSLockObj () | |
| Construct the OSLockObj and call OSLock() to prevent task switching. | |
| ~OSLockObj () | |
| Destruct the OSLockObj and call OSUnlock() to allow task switching. | |
RAII wrapper for OSLock()/OSUnlock() that prevents task switching within a scope.
The constructor calls OSLock() and the destructor calls OSUnlock(), ensuring the lock is always released when the object goes out of scope, even if the function has multiple return paths or an exception occurs.
Expand for Example Usage