#include <pthread.h>
#include <signal.h>
#include <sys/thread.h>
#include <stdio.h>
#include <stdlib.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 AtomicInc | ( | p | ) | (++(*p)) |
#define AtomicDec | ( | p | ) | (--(*p)) |
#define NutEnterCritical | ( | void | ) |
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 | ) |
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() |
sigset_t irq_signal |
Referenced by NutThreadCreate(), and NutTimerEmulation().
pthread_cond_t irq_cv |
Referenced by NutThreadCreate(), and NutTraceOs().
Referenced by NutThreadCreate(), and NutTraceOs().