Skip to content

Commit b8b258a

Browse files
committed
冲突同步
1 parent cad855b commit b8b258a

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/scheduler_up.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX];
4646
rt_uint32_t rt_thread_ready_priority_group;
4747
rt_base_t rt_thread_ready_highest_priority;
4848
#if RT_THREAD_PRIORITY_MAX > 32
49-
/* Maximum priority level, 256 */
50-
rt_uint8_t rt_thread_ready_table[32];
49+
/* Maximum priority level, 256 */
50+
rt_uint8_t rt_thread_ready_table[32];
5151
#endif /* RT_THREAD_PRIORITY_MAX > 32 */
5252

5353
extern volatile rt_atomic_t rt_interrupt_nest;
@@ -108,7 +108,7 @@ _scheduler_get_priority_thread(rt_ubase_t priority)
108108
{
109109
/* get highest ready priority thread */
110110
return RT_THREAD_LIST_NODE_ENTRY(
111-
rt_thread_priority_table[priority].next);
111+
rt_thread_priority_table[priority].next);
112112
}
113113

114114
rt_err_t rt_sched_lock(rt_sched_lock_level_t *plvl)
@@ -176,7 +176,7 @@ void rt_system_scheduler_start(void)
176176

177177
_scheduler_update_highest_priority();
178178
to_thread = _scheduler_get_priority_thread(
179-
rt_thread_ready_highest_priority);
179+
rt_thread_ready_highest_priority);
180180

181181
rt_cpu_self()->current_thread = to_thread;
182182

@@ -209,15 +209,15 @@ rt_inline void _rt_sched_insert_thread(struct rt_thread *thread)
209209
{
210210
rt_list_insert_before(
211211
&(rt_thread_priority_table[RT_SCHED_PRIV(thread)
212-
.current_priority]),
212+
.current_priority]),
213213
&RT_THREAD_LIST_NODE(thread));
214214
}
215215
/* there are some time slices left, inserting thread after ready list to schedule it firstly at next time*/
216216
else
217217
{
218218
rt_list_insert_after(
219219
&(rt_thread_priority_table[RT_SCHED_PRIV(thread)
220-
.current_priority]),
220+
.current_priority]),
221221
&RT_THREAD_LIST_NODE(thread));
222222
}
223223

@@ -249,7 +249,7 @@ rt_inline void _rt_sched_remove_thread(struct rt_thread *thread)
249249
/* remove thread from ready list */
250250
rt_list_remove(&RT_THREAD_LIST_NODE(thread));
251251
if (rt_list_isempty(
252-
&(rt_thread_priority_table[RT_SCHED_PRIV(thread)
252+
&(rt_thread_priority_table[RT_SCHED_PRIV(thread)
253253
.current_priority])))
254254
{
255255
#if RT_THREAD_PRIORITY_MAX > 32
@@ -293,9 +293,8 @@ void rt_schedule(void)
293293
/* check the scheduler is enabled or not */
294294
if (rt_scheduler_lock_nest == 0 && rt_thread_ready_priority_group)
295295
{
296-
297296
need_insert_from_thread = RT_FALSE;
298-
curr_thread = rt_thread_self();
297+
curr_thread = rt_thread_self();
299298

300299
if ((RT_SCHED_CTX(curr_thread).stat & RT_THREAD_STAT_MASK) == RT_THREAD_RUNNING)
301300
{
@@ -310,14 +309,14 @@ void rt_schedule(void)
310309
else
311310
{
312311
to_thread = _scheduler_get_priority_thread(
313-
rt_thread_ready_highest_priority);
312+
rt_thread_ready_highest_priority);
314313
need_insert_from_thread = RT_TRUE;
315314
}
316315
}
317316
else
318317
{
319318
to_thread = _scheduler_get_priority_thread(
320-
rt_thread_ready_highest_priority);
319+
rt_thread_ready_highest_priority);
321320
}
322321

323322
if (to_thread != curr_thread)
@@ -446,8 +445,7 @@ void rt_sched_thread_startup(struct rt_thread *thread)
446445
* - Initializes priority masks (number_mask, number, high_mask for >32 priorities)
447446
* - Sets initial and remaining time slice ticks
448447
*/
449-
void rt_sched_thread_init_priv(struct rt_thread *thread, rt_uint32_t tick,
450-
rt_uint8_t priority)
448+
void rt_sched_thread_init_priv(struct rt_thread *thread, rt_uint32_t tick, rt_uint8_t priority)
451449
{
452450
rt_list_init(&RT_THREAD_LIST_NODE(thread));
453451

0 commit comments

Comments
 (0)