sched/pthread: add missing FAR and fix alignment issues

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2023-07-07 12:06:36 +03:00 committed by Alan Carvalho de Assis
parent 0370aa9988
commit a0b19226a1
2 changed files with 14 additions and 14 deletions

View File

@ -50,13 +50,13 @@
struct join_s struct join_s
{ {
FAR struct join_s *next; /* Implements link list */ FAR struct join_s *next; /* Implements link list */
uint8_t crefs; /* Reference count */ uint8_t crefs; /* Reference count */
bool detached; /* true: pthread_detached'ed */ bool detached; /* true: pthread_detached'ed */
bool terminated; /* true: detach'ed+exit'ed */ bool terminated; /* true: detach'ed+exit'ed */
pthread_t thread; /* Includes pid */ pthread_t thread; /* Includes pid */
sem_t exit_sem; /* Implements join */ sem_t exit_sem; /* Implements join */
sem_t data_sem; /* Implements join */ sem_t data_sem; /* Implements join */
pthread_addr_t exit_value; /* Returned data */ 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); int pthread_sem_take(FAR sem_t *sem, FAR const struct timespec *abs_timeout);
#ifdef CONFIG_PTHREAD_MUTEX_UNSAFE #ifdef CONFIG_PTHREAD_MUTEX_UNSAFE
int pthread_sem_trytake(sem_t *sem); int pthread_sem_trytake(FAR sem_t *sem);
#endif #endif
int pthread_sem_give(sem_t *sem); int pthread_sem_give(FAR sem_t *sem);
#ifndef CONFIG_PTHREAD_MUTEX_UNSAFE #ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
int pthread_mutex_take(FAR struct pthread_mutex_s *mutex, 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); int pthread_mutex_give(FAR struct pthread_mutex_s *mutex);
void pthread_mutex_inconsistent(FAR struct tcb_s *tcb); void pthread_mutex_inconsistent(FAR struct tcb_s *tcb);
#else #else
# define pthread_mutex_take(m,abs_timeout) pthread_sem_take(&(m)->sem,(abs_timeout)) # 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_trytake(m) pthread_sem_trytake(&(m)->sem)
# define pthread_mutex_give(m) pthread_sem_give(&(m)->sem) # define pthread_mutex_give(m) pthread_sem_give(&(m)->sem)
#endif #endif
#ifdef CONFIG_PTHREAD_MUTEX_TYPES #ifdef CONFIG_PTHREAD_MUTEX_TYPES

View File

@ -75,7 +75,7 @@ int pthread_sem_take(FAR sem_t *sem, FAR const struct timespec *abs_timeout)
} }
#ifdef CONFIG_PTHREAD_MUTEX_UNSAFE #ifdef CONFIG_PTHREAD_MUTEX_UNSAFE
int pthread_sem_trytake(sem_t *sem) int pthread_sem_trytake(FAR sem_t *sem)
{ {
int ret = EINVAL; int ret = EINVAL;
@ -94,7 +94,7 @@ int pthread_sem_trytake(sem_t *sem)
} }
#endif #endif
int pthread_sem_give(sem_t *sem) int pthread_sem_give(FAR sem_t *sem)
{ {
int ret; int ret;