From a0b19226a14f96cd52b20eb5cbd1666a569b1727 Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Fri, 7 Jul 2023 12:06:36 +0300 Subject: [PATCH] sched/pthread: add missing FAR and fix alignment issues Signed-off-by: Petro Karashchenko --- sched/pthread/pthread.h | 24 ++++++++++++------------ sched/pthread/pthread_initialize.c | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sched/pthread/pthread.h b/sched/pthread/pthread.h index 22f2cd3b8b..e53ad3e537 100644 --- a/sched/pthread/pthread.h +++ b/sched/pthread/pthread.h @@ -50,13 +50,13 @@ struct join_s { FAR struct join_s *next; /* Implements link list */ - uint8_t crefs; /* Reference count */ - bool detached; /* true: pthread_detached'ed */ - bool terminated; /* true: detach'ed+exit'ed */ - pthread_t thread; /* Includes pid */ - sem_t exit_sem; /* Implements join */ - sem_t data_sem; /* Implements join */ - pthread_addr_t exit_value; /* Returned data */ + uint8_t crefs; /* Reference count */ + bool detached; /* true: pthread_detached'ed */ + bool terminated; /* true: detach'ed+exit'ed */ + pthread_t thread; /* Includes pid */ + sem_t exit_sem; /* Implements join */ + sem_t data_sem; /* Implements join */ + pthread_addr_t exit_value; /* Returned data */ }; /**************************************************************************** @@ -90,9 +90,9 @@ void pthread_release(FAR struct task_group_s *group); int pthread_sem_take(FAR sem_t *sem, FAR const struct timespec *abs_timeout); #ifdef CONFIG_PTHREAD_MUTEX_UNSAFE -int pthread_sem_trytake(sem_t *sem); +int pthread_sem_trytake(FAR sem_t *sem); #endif -int pthread_sem_give(sem_t *sem); +int pthread_sem_give(FAR sem_t *sem); #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE int pthread_mutex_take(FAR struct pthread_mutex_s *mutex, @@ -101,9 +101,9 @@ int pthread_mutex_trytake(FAR struct pthread_mutex_s *mutex); int pthread_mutex_give(FAR struct pthread_mutex_s *mutex); void pthread_mutex_inconsistent(FAR struct tcb_s *tcb); #else -# define pthread_mutex_take(m,abs_timeout) pthread_sem_take(&(m)->sem,(abs_timeout)) -# define pthread_mutex_trytake(m) pthread_sem_trytake(&(m)->sem) -# define pthread_mutex_give(m) pthread_sem_give(&(m)->sem) +# define pthread_mutex_take(m,abs_timeout) pthread_sem_take(&(m)->sem,(abs_timeout)) +# define pthread_mutex_trytake(m) pthread_sem_trytake(&(m)->sem) +# define pthread_mutex_give(m) pthread_sem_give(&(m)->sem) #endif #ifdef CONFIG_PTHREAD_MUTEX_TYPES diff --git a/sched/pthread/pthread_initialize.c b/sched/pthread/pthread_initialize.c index 479ad2c6d7..acb0964b9f 100644 --- a/sched/pthread/pthread_initialize.c +++ b/sched/pthread/pthread_initialize.c @@ -75,7 +75,7 @@ int pthread_sem_take(FAR sem_t *sem, FAR const struct timespec *abs_timeout) } #ifdef CONFIG_PTHREAD_MUTEX_UNSAFE -int pthread_sem_trytake(sem_t *sem) +int pthread_sem_trytake(FAR sem_t *sem) { int ret = EINVAL; @@ -94,7 +94,7 @@ int pthread_sem_trytake(sem_t *sem) } #endif -int pthread_sem_give(sem_t *sem) +int pthread_sem_give(FAR sem_t *sem) { int ret;