Nut/OS  5.0.5
API Reference
atom.h File Reference
#include <pthread.h>
#include <signal.h>
#include <sys/thread.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for atom.h:

Go to the source code of this file.

Defines

#define AtomicInc(p)   (++(*p))
#define AtomicDec(p)   (--(*p))
#define NutEnterCritical()
#define NutExitCritical()
#define NutJumpOutCritical()   NutExitCritical()

Variables

uint16_t main_cs_level
sigset_t irq_signal
pthread_cond_t irq_cv
uint16_t int_disabled
FILE__os_trs
uint8_t __os_trf

Define Documentation

#define AtomicInc (   p)    (++(*p))
#define AtomicDec (   p)    (--(*p))
#define NutEnterCritical (   void)
Value:
pthread_sigmask(SIG_BLOCK, &irq_signal, 0);         \
    int_disabled = 1;                                   \
    if (runningThread) {                                \
        runningThread->td_cs_level++;                   \
    } else {                                            \
        main_cs_level++;                                \
    }                                                   \
    pthread_sigmask(SIG_UNBLOCK, &irq_signal, 0);
#define NutExitCritical (   void)
Value:
pthread_sigmask(SIG_BLOCK, &irq_signal, 0);         \
    if (runningThread) {                                \
        if (--runningThread->td_cs_level == 0) {        \
            int_disabled = 0;                           \
            pthread_cond_signal(&irq_cv);               \
        }                                               \
    } else {                                            \
        if (--main_cs_level == 0) {                     \
            int_disabled = 0;                           \
            pthread_cond_signal(&irq_cv);               \
        }                                               \
    }                                                   \
    pthread_sigmask(SIG_UNBLOCK, &irq_signal, 0);
#define NutJumpOutCritical ( )    NutExitCritical()

Variable Documentation

sigset_t irq_signal
pthread_cond_t irq_cv