File tree 4 files changed +26
-26
lines changed
4 files changed +26
-26
lines changed Original file line number Diff line number Diff line change @@ -157,20 +157,6 @@ extern volatile kernel_pid_t sched_active_pid;
157
157
*/
158
158
extern clist_node_t * sched_runqueues [SCHED_PRIO_LEVELS ];
159
159
160
- /**
161
- * @brief Lets current thread yield in favor of a higher prioritized thread.
162
- *
163
- * @details The current thread will resume operation immediately,
164
- * if there is no other ready thread with a higher priority.
165
- *
166
- * Differently from thread_yield() the current thread will be scheduled next
167
- * in its own priority class, i.e. it stays the first thread in its
168
- * priority class.
169
- *
170
- * @see thread_yield()
171
- */
172
- void thread_yield_higher (void );
173
-
174
160
#if SCHEDSTATISTICS
175
161
/**
176
162
* Scheduler statistics
Original file line number Diff line number Diff line change @@ -134,6 +134,20 @@ void thread_sleep(void);
134
134
*/
135
135
void thread_yield (void );
136
136
137
+ /**
138
+ * @brief Lets current thread yield in favor of a higher prioritized thread.
139
+ *
140
+ * @details The current thread will resume operation immediately,
141
+ * if there is no other ready thread with a higher priority.
142
+ *
143
+ * Differently from thread_yield() the current thread will be scheduled next
144
+ * in its own priority class, i.e. it stays the first thread in its
145
+ * priority class.
146
+ *
147
+ * @see thread_yield()
148
+ */
149
+ void thread_yield_higher (void );
150
+
137
151
/**
138
152
* @brief Wakes up a sleeping thread.
139
153
*
Original file line number Diff line number Diff line change @@ -179,15 +179,3 @@ NORETURN void sched_task_exit(void)
179
179
sched_active_thread = NULL ;
180
180
cpu_switch_context_exit ();
181
181
}
182
-
183
- void thread_yield (void )
184
- {
185
- unsigned old_state = disableIRQ ();
186
- tcb_t * me = (tcb_t * )sched_active_thread ;
187
- if (me -> status >= STATUS_ON_RUNQUEUE ) {
188
- clist_advance (& sched_runqueues [me -> priority ]);
189
- }
190
- restoreIRQ (old_state );
191
-
192
- thread_yield_higher ();
193
- }
Original file line number Diff line number Diff line change @@ -89,6 +89,18 @@ int thread_wakeup(kernel_pid_t pid)
89
89
}
90
90
}
91
91
92
+ void thread_yield (void )
93
+ {
94
+ unsigned old_state = disableIRQ ();
95
+ tcb_t * me = (tcb_t * )sched_active_thread ;
96
+ if (me -> status >= STATUS_ON_RUNQUEUE ) {
97
+ clist_advance (& sched_runqueues [me -> priority ]);
98
+ }
99
+ restoreIRQ (old_state );
100
+
101
+ thread_yield_higher ();
102
+ }
103
+
92
104
#ifdef DEVELHELP
93
105
uintptr_t thread_measure_stack_free (char * stack )
94
106
{
You can’t perform that action at this time.
0 commit comments