summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadenabledispatch.c
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2011-04-21 19:05:15 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2011-04-21 19:05:15 +0000
commitd7c388321ad2f250cb35f01dc4c8dda7489c3416 (patch)
tree292c6c350e7f96ddb3cc0a910433ceb296c24db1 /cpukit/score/src/threadenabledispatch.c
parent2011-04-21 Jennifer Averett <Jennifer.Averett@OARcorp.com (diff)
downloadrtems-d7c388321ad2f250cb35f01dc4c8dda7489c3416.tar.bz2
2011-04-21 Jennifer Averett <Jennifer.Averett@OARcorp.com
PR 1777/cpukit * libcsupport/src/malloc_deferred.c, libcsupport/src/realloc.c, score/Makefile.am, score/cpu/lm32/irq.c, score/cpu/nios2/irq.c, score/include/rtems/score/coremutex.h, score/include/rtems/score/thread.h, score/inline/rtems/score/thread.inl, score/src/heapfree.c, score/src/pheapwalk.c, score/src/smp.c, score/src/threaddispatch.c: Consolidated access to _Thread_Dispatch_disable_level. * score/src/threaddisabledispatch.c, score/src/threadenabledispatch.c: New files.
Diffstat (limited to '')
-rw-r--r--cpukit/score/src/threadenabledispatch.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/cpukit/score/src/threadenabledispatch.c b/cpukit/score/src/threadenabledispatch.c
new file mode 100644
index 0000000000..20f874a954
--- /dev/null
+++ b/cpukit/score/src/threadenabledispatch.c
@@ -0,0 +1,49 @@
+/*
+ * _Thread_Enable_dispatch
+ *
+ *
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/thread.h>
+
+#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
+ #include <rtems/score/timestamp.h>
+#endif
+
+
+/**
+ * The following declares the dispatch critical section nesting
+ * counter which is used to prevent context switches at inopportune
+ * moments.
+ */
+
+/**
+ * _Thread_Enable_dispatch
+ *
+ * This kernel routine exits a context switch disable critical section.
+ * This is the NOT INLINED version.
+ *
+ * INTERRUPT LATENCY:
+ * dispatch thread
+ * no dispatch thread
+ */
+#if defined (__THREAD_DO_NOT_INLINE_ENABLE_DISPATCH__ )
+void _Thread_Enable_dispatch( void )
+{
+ if ( --_Thread_Dispatch_disable_level )
+ return;
+ _Thread_Dispatch();
+}
+#endif