X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fproc.h;h=f8de758ffeec511879400f20d750311d3b3c992b;hb=1cdcadf620678aca50bc36a0ff24986140720f3b;hp=d1525db7bd68e8be1a0ee3c2b6119c3fd342bb0c;hpb=577884080ce0b66cf40d0aa898b3611a5cf0c336;p=bertos.git diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index d1525db7..f8de758f 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -85,6 +85,9 @@ const char *proc_currentName(void); } #endif +/** Global preemption disable nesting counter. */ +extern int preempt_forbid_cnt; + /** * Disable preemptive task switching. * @@ -106,7 +109,6 @@ INLINE void proc_forbid(void) { #if CONFIG_KERN_PREEMPT // No need to protect against interrupts here. - extern int preempt_forbid_cnt; ++preempt_forbid_cnt; /* @@ -133,7 +135,6 @@ INLINE void proc_permit(void) MEMORY_BARRIER; /* No need to protect against interrupts here. */ - extern int preempt_forbid_cnt; --preempt_forbid_cnt; ASSERT(preempt_forbid_cnt >= 0); @@ -146,7 +147,6 @@ INLINE void proc_permit(void) #endif } - /** * Execute a block of \a CODE atomically with respect to task scheduling. */