summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--schedsim/shell/shared/main_semdelete.c17
-rw-r--r--schedsim/shell/shared/schedsim_shell.h14
2 files changed, 24 insertions, 7 deletions
diff --git a/schedsim/shell/shared/main_semdelete.c b/schedsim/shell/shared/main_semdelete.c
index ed227b3..4a706b8 100644
--- a/schedsim/shell/shared/main_semdelete.c
+++ b/schedsim/shell/shared/main_semdelete.c
@@ -1,7 +1,10 @@
+/**
+ * @file
+ * @brief Task Delete Shell Command Implmentation
+ */
+
/*
- * Task Delete Shell Command Implmentation
- *
- * COPYRIGHT (c) 1989-2013.
+ * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -44,7 +47,13 @@ int rtems_shell_main_semaphore_delete(
*/
printf("Deleting semaphore (0x%08x)\n", id );
- status = rtems_semaphore_delete( id );
+ /*
+ * This wraps the allocator mutex and should defer any context switching
+ */
+ schedsim_set_allow_dispatch(false);
+ status = rtems_semaphore_delete( id );
+ schedsim_set_allow_dispatch(true);
+
if ( status != RTEMS_SUCCESSFUL ) {
fprintf(
stderr,
diff --git a/schedsim/shell/shared/schedsim_shell.h b/schedsim/shell/shared/schedsim_shell.h
index d1f2406..15685bc 100644
--- a/schedsim/shell/shared/schedsim_shell.h
+++ b/schedsim/shell/shared/schedsim_shell.h
@@ -1,7 +1,12 @@
-/*
- * BASED UPON SOURCE IN RTEMS, MODIFIED FOR SIMULATOR
+/**
+ * @file
+ * @brief Scheduler Simulator Internals
*
- * COPYRIGHT (c) 1989-2013.
+ * @note BASED UPON SOURCE IN RTEMS, MODIFIED FOR SIMULATOR
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -30,6 +35,9 @@ extern "C" {
void PRINT_EXECUTING(void);
void PRINT_HEIR(void);
+void schedsim_set_allow_dispatch(bool value);
+bool schedsim_is_dispatch_allowed(void);
+
struct rtems_shell_topic_tt;
typedef struct rtems_shell_topic_tt rtems_shell_topic_t;