110 |
In some implementations they can provide a more light-weight protection |
In some implementations they can provide a more light-weight protection |
111 |
mechanism than using semaphores. Otherwise semaphores can be used for |
mechanism than using semaphores. Otherwise semaphores can be used for |
112 |
implementation */ |
implementation */ |
113 |
|
#ifndef SYS_ARCH_PROTECT |
114 |
|
#ifdef SYS_LIGHTWEIGHT_PROT |
115 |
|
#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev |
116 |
|
#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect() |
117 |
|
#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev) |
118 |
|
|
119 |
sys_prot_t sys_arch_protect(void); |
sys_prot_t sys_arch_protect(void); |
120 |
void sys_arch_unprotect(sys_prot_t pval); |
void sys_arch_unprotect(sys_prot_t pval); |
121 |
|
#else /* SYS_LIGHTWEIGHT_PROT */ |
122 |
|
#define SYS_ARCH_DECL_PROTECT(lev) |
123 |
|
#define SYS_ARCH_PROTECT(lev) |
124 |
|
#define SYS_ARCH_UNPROTECT(lev) |
125 |
|
#endif /* SYS_LIGHTWEIGHT_PROT */ |
126 |
|
|
127 |
|
#endif /* SYS_ARCH_PROTECT */ |
128 |
|
|
129 |
/* Thread functions. */ |
/* Thread functions. */ |
130 |
sys_thread_t sys_thread_new(void (* thread)(void *arg), void *arg); |
sys_thread_t sys_thread_new(void (* thread)(void *arg), void *arg); |