summaryrefslogtreecommitdiff
path: root/cpukit/score/include/rtems/score/threadq.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-03-05 21:01:40 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-03-05 21:01:40 +0000
commit96d0b64c620a2107a5d6b076a17ab26fca6b2a39 (patch)
tree1abb8637b91640982eff0d1d3a4f64e624182cca /cpukit/score/include/rtems/score/threadq.h
parent471998ecc4bdbf8c20abcad4c7ddc06e0658a0dc (diff)
2007-03-05 Joel Sherrill <joel@OARcorp.com>
PR 1222/cpukit * score/Makefile.am, score/include/rtems/score/coremutex.h, score/include/rtems/score/threadq.h, score/inline/rtems/score/coremutex.inl, score/src/coremsgsubmit.c, score/src/coremutexsurrender.c, score/src/threadchangepriority.c, score/src/threadclearstate.c, score/src/threadhandler.c, score/src/threadinitialize.c, score/src/threadqdequeuefifo.c, score/src/threadqdequeuepriority.c, score/src/threadqenqueue.c, score/src/threadqenqueuefifo.c, score/src/threadqenqueuepriority.c, score/src/threadqextractfifo.c, score/src/threadqextractpriority.c, score/src/threadsetstate.c: Enhance so that when the prioirity of a thread that is blocked on a priority based thread queue is changed, that its placement in the queue is reevaluated based upon the new priority. This enhancement includes modifications to the SuperCore as well as new test cases. * score/src/threadqrequeue.c: New file.
Diffstat (limited to 'cpukit/score/include/rtems/score/threadq.h')
-rw-r--r--cpukit/score/include/rtems/score/threadq.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h
index 8744887344..7b609285eb 100644
--- a/cpukit/score/include/rtems/score/threadq.h
+++ b/cpukit/score/include/rtems/score/threadq.h
@@ -94,6 +94,20 @@ void _Thread_queue_Enqueue_with_handler(
Thread_queue_Timeout_callout handler
);
+/**
+ * @brief Thread queue Requeue
+ *
+ * This routine is invoked when a thread changes priority and is
+ * blocked on a thread queue. If the queue is priority ordered,
+ * the_thread is removed from the_thread_queue and reinserted using
+ * its new priority. This method has no impact on the state of the_thread
+ * or of any timeouts associated with this blocking.
+ */
+void _Thread_queue_Requeue(
+ Thread_queue_Control *the_thread_queue,
+ Thread_Control *the_thread
+);
+
/** @brief Thread queue Extract
*
* This routine removes the_thread from the_thread_queue
@@ -169,16 +183,27 @@ void _Thread_queue_Enqueue_priority(
Thread_Control *the_thread
);
-/** @brief Thread queue Extract priority
+/** @brief Thread queue Extract priority Helper
*
* This routine removes the_thread from the_thread_queue
* and cancels any timeouts associated with this blocking.
*/
-void _Thread_queue_Extract_priority(
+void _Thread_queue_Extract_priority_helper(
Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
+ Thread_Control *the_thread,
+ boolean requeuing
);
+/**
+ * @brief Thread queue Extract priority
+ *
+ * This macro wraps the underlying call and hides the requeuing argument.
+ */
+
+#define _Thread_queue_Extract_priority( _the_thread_queue, _the_thread ) \
+ _Thread_queue_Extract_priority_helper( _the_thread_queue, _the_thread, FALSE )
+
+
/** @brief Thread queue First priority
*
* This function returns a pointer to the "first" thread