summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqops.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-10 15:07:35 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-08-12 20:58:26 +0200
commita5aaf20a2d25846c2bfe78e286550fed38d2c111 (patch)
tree6918797e365abb7fba28ef3adc9ef2ed260bde02 /cpukit/score/src/threadqops.c
parentrtems: Fix rtems_partition_return_buffer() (diff)
downloadrtems-a5aaf20a2d25846c2bfe78e286550fed38d2c111.tar.bz2
score: Replace priority prepend it with an enum
Use the new Priority_Group_order enum instead of a boolean to indicated if a priority should be inserted as the first or last node into its priority group. This makes the code more expressive. It is also a bit more efficient since a branch in _Scheduler_Node_set_priority() is avoided and a simple bitwise or operation can be used.
Diffstat (limited to 'cpukit/score/src/threadqops.c')
-rw-r--r--cpukit/score/src/threadqops.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c
index d6ba9dad57..eb01002679 100644
--- a/cpukit/score/src/threadqops.c
+++ b/cpukit/score/src/threadqops.c
@@ -700,7 +700,7 @@ static void _Thread_queue_Priority_inherit_do_priority_actions_remove(
static void _Thread_queue_Priority_inherit_do_priority_actions_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -787,7 +787,7 @@ static void _Thread_queue_Priority_inherit_priority_actions(
_Priority_Changed(
&priority_queue->Queue,
&scheduler_node->Wait.Priority.Node,
- false,
+ PRIORITY_GROUP_LAST,
priority_actions,
_Thread_queue_Priority_inherit_do_priority_actions_change,
scheduler_node_of_owner
@@ -884,7 +884,7 @@ static void _Thread_queue_Priority_inherit_do_initialize(
static void _Thread_queue_Priority_inherit_do_enqueue_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -1079,7 +1079,7 @@ static void _Thread_queue_Priority_inherit_do_extract_remove(
static void _Thread_queue_Priority_inherit_do_extract_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -1231,7 +1231,7 @@ static void _Thread_queue_Priority_inherit_do_surrender_add(
_Scheduler_Node_set_priority(
scheduler_node,
_Priority_Get_priority( priority_aggregation ),
- false
+ PRIORITY_GROUP_LAST
);
}
@@ -1254,7 +1254,7 @@ static void _Thread_queue_Priority_inherit_do_surrender_remove(
static void _Thread_queue_Priority_inherit_do_surrender_change(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -1270,14 +1270,14 @@ static void _Thread_queue_Priority_inherit_do_surrender_change(
_Scheduler_Node_set_priority(
SCHEDULER_NODE_OF_WAIT_PRIORITY( priority_aggregation ),
_Priority_Get_priority( priority_aggregation ),
- prepend_it
+ priority_group_order
);
}
#if defined(RTEMS_SMP)
static void _Thread_queue_Priority_inherit_do_surrender_change_2(
Priority_Aggregation *priority_aggregation,
- bool prepend_it,
+ Priority_Group_order priority_group_order,
Priority_Actions *priority_actions,
void *arg
)
@@ -1285,7 +1285,7 @@ static void _Thread_queue_Priority_inherit_do_surrender_change_2(
_Scheduler_Node_set_priority(
SCHEDULER_NODE_OF_WAIT_PRIORITY( priority_aggregation ),
_Priority_Get_priority( priority_aggregation ),
- prepend_it
+ priority_group_order
);
}
#endif