posix: pthread: Remove dead code warning

It is better to put LOG_ERR() before K_SPINLOCK_BREAK().

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2023-09-23 16:18:24 +03:00 committed by Fabio Baltieri
parent b892a4bc49
commit 3d82fbe357

View file

@ -667,15 +667,15 @@ int pthread_join(pthread_t pthread, void **status)
{
if (t->detachstate != PTHREAD_CREATE_JOINABLE) {
ret = EINVAL;
K_SPINLOCK_BREAK;
LOG_ERR("Pthread %p is not a joinable", &t->thread);
K_SPINLOCK_BREAK;
}
if (t->qid == POSIX_THREAD_READY_Q) {
/* in case thread has moved to ready_q between to_posix_thread() and here */
ret = ESRCH;
K_SPINLOCK_BREAK;
LOG_ERR("Pthread %p has already been joined", &t->thread);
K_SPINLOCK_BREAK;
}
/*