## NAME

Nano_lock, Nano_unlock - lock and unlock tasks switching

## SYNOPSIS

#include <sys.h>

void Nano_lock(void);

void Nano_unlock(void);

unsigned int getlocklevel(void);

## DESCRIPTION

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.

## RETURN VALUES

The getlocklevel() returns 1 if lock active (threads switching is disabled) and 0 if lock non-active (threads switching is enabled).

## EXAMPLES

    #include <sys.h>

        . . .
        Nano_lock();

        /*
         * This code will not be interrupted by other threads
         */

        Nano_unlock();
        . . .

## SEE ALSO

i_disable() / i_restore()

#### Home page (Kernel)

## < Copyright Rowebots Research Inc. and Multiprocessor Toolsmiths Inc. 1987-2018 >