summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqops.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/threadqops.c')
-rw-r--r--cpukit/score/src/threadqops.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c
new file mode 100644
index 0000000000..561480130a
--- /dev/null
+++ b/cpukit/score/src/threadqops.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2015 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <rtems/score/threadimpl.h>
+#include <rtems/score/rbtreeimpl.h>
+
+static void _Thread_queue_Do_nothing_priority_change(
+ Thread_Control *the_thread,
+ Priority_Control new_priority,
+ Thread_queue_Control *queue
+)
+{
+ /* Do nothing */
+}
+
+static void _Thread_queue_Priority_priority_change(
+ Thread_Control *the_thread,
+ Priority_Control new_priority,
+ Thread_queue_Control *queue
+)
+{
+ _RBTree_Extract( &queue->Queues.Priority, &the_thread->RBNode );
+ _RBTree_Insert(
+ &queue->Queues.Priority,
+ &the_thread->RBNode,
+ _Thread_queue_Compare_priority,
+ false
+ );
+}
+
+const Thread_queue_Operations _Thread_queue_Operations_default = {
+ .priority_change = _Thread_queue_Do_nothing_priority_change
+};
+
+const Thread_queue_Operations _Thread_queue_Operations_FIFO = {
+ .priority_change = _Thread_queue_Do_nothing_priority_change
+};
+
+const Thread_queue_Operations _Thread_queue_Operations_priority = {
+ .priority_change = _Thread_queue_Priority_priority_change
+};