kernel: Change _reschedule signature
_reschedule return's value is not used anywhere, except erroneously by pthread_barrier_wait. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
abffd83d26
commit
98c64b6d92
4 changed files with 11 additions and 6 deletions
|
@ -38,7 +38,7 @@ int _is_thread_time_slicing(struct k_thread *thread);
|
|||
void _unpend_thread_no_timeout(struct k_thread *thread);
|
||||
int _pend_current_thread(int key, _wait_q_t *wait_q, s32_t timeout);
|
||||
void _pend_thread(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout);
|
||||
int _reschedule(int key);
|
||||
void _reschedule(int key);
|
||||
struct k_thread *_unpend_first_thread(_wait_q_t *wait_q);
|
||||
void _unpend_thread(struct k_thread *thread);
|
||||
int _unpend_all(_wait_q_t *wait_q);
|
||||
|
|
|
@ -376,7 +376,7 @@ void _thread_priority_set(struct k_thread *thread, int prio)
|
|||
}
|
||||
}
|
||||
|
||||
int _reschedule(int key)
|
||||
void _reschedule(int key)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
if (!_current_cpu->swap_ok) {
|
||||
|
@ -394,13 +394,13 @@ int _reschedule(int key)
|
|||
return _Swap(key);
|
||||
#else
|
||||
if (_get_next_ready_thread() != _current) {
|
||||
return _Swap(key);
|
||||
(void)_Swap(key);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
noswap:
|
||||
irq_unlock(key);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void k_sched_lock(void)
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
|
||||
int pthread_barrier_wait(pthread_barrier_t *b)
|
||||
{
|
||||
/* FIXME: This function should return PTHREAD_BARRIER_SERIAL_THREAD
|
||||
* for an arbitrary thread and 0 for the others.
|
||||
*/
|
||||
int key = irq_lock();
|
||||
|
||||
b->count++;
|
||||
|
@ -21,7 +24,8 @@ int pthread_barrier_wait(pthread_barrier_t *b)
|
|||
while (_waitq_head(&b->wait_q)) {
|
||||
_ready_one_thread(&b->wait_q);
|
||||
}
|
||||
return _reschedule(key);
|
||||
_reschedule(key);
|
||||
return 0;
|
||||
} else {
|
||||
return _pend_current_thread(key, &b->wait_q, K_FOREVER);
|
||||
}
|
||||
|
|
|
@ -141,7 +141,8 @@ int pthread_mutex_unlock(pthread_mutex_t *m)
|
|||
m->lock_count++;
|
||||
_ready_thread(thread);
|
||||
_set_thread_return_value(thread, 0);
|
||||
return _reschedule(key);
|
||||
_reschedule(key);
|
||||
return 0;
|
||||
}
|
||||
m->owner = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue