summaryrefslogtreecommitdiff
path: root/common_smp/src/tx_queue_prioritize.c
diff options
context:
space:
mode:
authorYuxin Zhou <[email protected]>2021-10-14 00:51:26 +0000
committerYuxin Zhou <[email protected]>2021-10-14 00:51:26 +0000
commit1af8404c54f9c8d3caa2ac3523c2a5f014aecb1c (patch)
tree93e4f4d64ec8c21c01b77f19b8e7326e85227e3d /common_smp/src/tx_queue_prioritize.c
parent215df45d4b59d4ce8606a88f566d1d426e64a84c (diff)
Release 6.1.9
Diffstat (limited to 'common_smp/src/tx_queue_prioritize.c')
-rw-r--r--common_smp/src/tx_queue_prioritize.c88
1 files changed, 45 insertions, 43 deletions
diff --git a/common_smp/src/tx_queue_prioritize.c b/common_smp/src/tx_queue_prioritize.c
index 54132aa4..ae80ce79 100644
--- a/common_smp/src/tx_queue_prioritize.c
+++ b/common_smp/src/tx_queue_prioritize.c
@@ -12,8 +12,8 @@
/**************************************************************************/
/**************************************************************************/
-/** */
-/** ThreadX Component */
+/** */
+/** ThreadX Component */
/** */
/** Queue */
/** */
@@ -31,43 +31,45 @@
#include "tx_queue.h"
-/**************************************************************************/
-/* */
-/* FUNCTION RELEASE */
-/* */
-/* _tx_queue_prioritize PORTABLE C */
+/**************************************************************************/
+/* */
+/* FUNCTION RELEASE */
+/* */
+/* _tx_queue_prioritize PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
-/* */
-/* This function places the highest priority suspended thread at the */
-/* front of the suspension list. All other threads remain in the same */
-/* FIFO suspension order. */
-/* */
-/* INPUT */
-/* */
-/* queue_ptr Pointer to queue control block */
-/* */
-/* OUTPUT */
-/* */
-/* status Completion status */
-/* */
-/* CALLS */
-/* */
-/* _tx_thread_system_preempt_check Check for preemption */
-/* */
-/* CALLED BY */
-/* */
-/* Application Code */
-/* */
-/* RELEASE HISTORY */
-/* */
+/* */
+/* This function places the highest priority suspended thread at the */
+/* front of the suspension list. All other threads remain in the same */
+/* FIFO suspension order. */
+/* */
+/* INPUT */
+/* */
+/* queue_ptr Pointer to queue control block */
+/* */
+/* OUTPUT */
+/* */
+/* status Completion status */
+/* */
+/* CALLS */
+/* */
+/* _tx_thread_system_preempt_check Check for preemption */
+/* */
+/* CALLED BY */
+/* */
+/* Application Code */
+/* */
+/* RELEASE HISTORY */
+/* */
/* DATE NAME DESCRIPTION */
/* */
-/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+/* 05-19-2020 William E. Lamie Initial Version 6.0 */
+/* 09-30-2020 Yuxin Zhou Modified comment(s), */
+/* resulting in version 6.1 */
/* */
/**************************************************************************/
UINT _tx_queue_prioritize(TX_QUEUE *queue_ptr)
@@ -75,8 +77,8 @@ UINT _tx_queue_prioritize(TX_QUEUE *queue_ptr)
TX_INTERRUPT_SAVE_AREA
-TX_THREAD *thread_ptr;
-TX_THREAD *priority_thread_ptr;
+TX_THREAD *thread_ptr;
+TX_THREAD *priority_thread_ptr;
TX_THREAD *head_ptr;
UINT suspended_count;
TX_THREAD *next_thread;
@@ -123,7 +125,7 @@ UINT list_changed;
/* Restore interrupts. */
TX_RESTORE
}
- else
+ else
{
/* Remember the suspension count and head pointer. */
@@ -159,28 +161,28 @@ UINT list_changed;
/* Disable interrupts again. */
TX_DISABLE
- /* Determine if any changes to the list have occurred while
+ /* Determine if any changes to the list have occurred while
interrupts were enabled. */
-
+
/* Is the list head the same? */
if (head_ptr != queue_ptr -> tx_queue_suspension_list)
{
-
+
/* The list head has changed, set the list changed flag. */
list_changed = TX_TRUE;
}
else
{
-
+
/* Is the suspended count the same? */
if (suspended_count != queue_ptr -> tx_queue_suspended_count)
{
-
+
/* The list head has changed, set the list changed flag. */
list_changed = TX_TRUE;
- }
+ }
}
-
+
/* Determine if the list has changed. */
if (list_changed == TX_FALSE)
{
@@ -210,12 +212,12 @@ UINT list_changed;
/* Release preemption. */
_tx_thread_preempt_disable--;
- /* Now determine if the highest priority thread is at the front
+ /* Now determine if the highest priority thread is at the front
of the list. */
if (priority_thread_ptr != head_ptr)
{
- /* No, we need to move the highest priority suspended thread to the
+ /* No, we need to move the highest priority suspended thread to the
front of the list. */
/* First, remove the highest priority thread by updating the