diff --git a/kernel/include/ksched.h b/kernel/include/ksched.h index 4954e6af4c5..93bf6bb6a28 100644 --- a/kernel/include/ksched.h +++ b/kernel/include/ksched.h @@ -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); diff --git a/kernel/sched.c b/kernel/sched.c index f014cedba45..6d56e6dd4a3 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -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) diff --git a/lib/posix/pthread_barrier.c b/lib/posix/pthread_barrier.c index cc5311819d8..e75cb8e6400 100644 --- a/lib/posix/pthread_barrier.c +++ b/lib/posix/pthread_barrier.c @@ -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); } diff --git a/lib/posix/pthread_mutex.c b/lib/posix/pthread_mutex.c index e9516724190..9c785a366d3 100644 --- a/lib/posix/pthread_mutex.c +++ b/lib/posix/pthread_mutex.c @@ -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;