Nano_lock, Nano_unlock - lock and unlock tasks switching
#include <sys.h>
void Nano_lock(void);
void Nano_unlock(void);
unsigned int getlocklevel(void);
The Nano_lock() function locks threads switching. All interrupt are active.
The Nano_unlock() function unlocks threads switching and causes threads scheduling.
The getlocklevel() returns current state of threads switching lock state.
The getlocklevel() returns 1 if lock active (threads switching is disabled) and 0 if lock non-active (threads switching is enabled).
#include <sys.h>
. . .
Nano_lock();
/*
* This code will not be interrupted by other threads
*/
Nano_unlock();
. . .