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:
Flavio Ceolin 2018-09-12 17:27:11 -07:00 committed by Anas Nashif
commit 98c64b6d92
4 changed files with 11 additions and 6 deletions

View file

@ -38,7 +38,7 @@ int _is_thread_time_slicing(struct k_thread *thread);
void _unpend_thread_no_timeout(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); 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); 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); struct k_thread *_unpend_first_thread(_wait_q_t *wait_q);
void _unpend_thread(struct k_thread *thread); void _unpend_thread(struct k_thread *thread);
int _unpend_all(_wait_q_t *wait_q); int _unpend_all(_wait_q_t *wait_q);

View file

@ -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 #ifdef CONFIG_SMP
if (!_current_cpu->swap_ok) { if (!_current_cpu->swap_ok) {
@ -394,13 +394,13 @@ int _reschedule(int key)
return _Swap(key); return _Swap(key);
#else #else
if (_get_next_ready_thread() != _current) { if (_get_next_ready_thread() != _current) {
return _Swap(key); (void)_Swap(key);
return;
} }
#endif #endif
noswap: noswap:
irq_unlock(key); irq_unlock(key);
return 0;
} }
void k_sched_lock(void) void k_sched_lock(void)

View file

@ -11,6 +11,9 @@
int pthread_barrier_wait(pthread_barrier_t *b) 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(); int key = irq_lock();
b->count++; b->count++;
@ -21,7 +24,8 @@ int pthread_barrier_wait(pthread_barrier_t *b)
while (_waitq_head(&b->wait_q)) { while (_waitq_head(&b->wait_q)) {
_ready_one_thread(&b->wait_q); _ready_one_thread(&b->wait_q);
} }
return _reschedule(key); _reschedule(key);
return 0;
} else { } else {
return _pend_current_thread(key, &b->wait_q, K_FOREVER); return _pend_current_thread(key, &b->wait_q, K_FOREVER);
} }

View file

@ -141,7 +141,8 @@ int pthread_mutex_unlock(pthread_mutex_t *m)
m->lock_count++; m->lock_count++;
_ready_thread(thread); _ready_thread(thread);
_set_thread_return_value(thread, 0); _set_thread_return_value(thread, 0);
return _reschedule(key); _reschedule(key);
return 0;
} }
m->owner = NULL; m->owner = NULL;