summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libcsupport/src/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/libcsupport/src/error.c')
-rw-r--r--c/src/exec/libcsupport/src/error.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/c/src/exec/libcsupport/src/error.c b/c/src/exec/libcsupport/src/error.c
index ab4693609e..dd32fb8b66 100644
--- a/c/src/exec/libcsupport/src/error.c
+++ b/c/src/exec/libcsupport/src/error.c
@@ -115,10 +115,8 @@ static int rtems_verror(
if (error_flag & RTEMS_ERROR_PANIC)
{
- rtems_panic_in_progress++;
-
- /* disable task switches */
- _Thread_Disable_dispatch();
+ if (rtems_panic_in_progress++)
+ _Thread_Disable_dispatch(); /* disable task switches */
/* don't aggravate things */
if (rtems_panic_in_progress > 2)