diff --git a/include/pthread.h b/include/pthread.h index bd45f87ee9e..50ea4fbb80a 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -774,11 +774,6 @@ int pthread_rwlock_clockwrlock(FAR pthread_rwlock_t *lock, int pthread_rwlock_trywrlock(FAR pthread_rwlock_t *lock); int pthread_rwlock_unlock(FAR pthread_rwlock_t *lock); -/* Pthread signal management APIs */ - -int pthread_kill(pthread_t thread, int sig); -int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); - #ifdef CONFIG_PTHREAD_SPINLOCKS /* Pthread spinlocks */ @@ -820,50 +815,11 @@ int pthread_atfork(CODE void (*prepare)(void), * available in any inclusion ordering. */ -#ifndef __PTHREAD_KEY_T_DEFINED -typedef int pthread_key_t; -# define __PTHREAD_KEY_T_DEFINED 1 -#endif - #ifndef __PTHREAD_ADDR_T_DEFINED typedef FAR void *pthread_addr_t; # define __PTHREAD_ADDR_T_DEFINED 1 #endif -#ifndef __PTHREAD_ATTR_T_DEFINED -struct pthread_attr_s; -typedef struct pthread_attr_s pthread_attr_t; -# define __PTHREAD_ATTR_T_DEFINED 1 -#endif - -#ifndef __PTHREAD_T_DEFINED -typedef pid_t pthread_t; -# define __PTHREAD_T_DEFINED 1 -#endif - -#ifndef __PTHREAD_CONDATTR_T_DEFINED -typedef struct pthread_condattr_s pthread_condattr_t; -# define __PTHREAD_CONDATTR_T_DEFINED 1 -#endif - -#ifndef __PTHREAD_COND_T_DEFINED -struct pthread_cond_s; -typedef struct pthread_cond_s pthread_cond_t; -# define __PTHREAD_COND_T_DEFINED 1 -#endif - -#ifndef __PTHREAD_MUTEXATTR_T_DEFINED -struct pthread_mutexattr_s; -typedef struct pthread_mutexattr_s pthread_mutexattr_t; -# define __PTHREAD_MUTEXATTR_T_DEFINED 1 -#endif - -#ifndef __PTHREAD_MUTEX_T_DEFINED -struct pthread_mutex_s; -typedef struct pthread_mutex_s pthread_mutex_t; -# define __PTHREAD_MUTEX_T_DEFINED 1 -#endif - #ifndef __PTHREAD_BARRIERATTR_T_DEFINED struct pthread_barrierattr_s; typedef struct pthread_barrierattr_s pthread_barrierattr_t; @@ -896,10 +852,4 @@ typedef struct pthread_spinlock_s pthread_spinlock_t; # endif #endif /* CONFIG_PTHREAD_SPINLOCKS */ -#ifndef __PTHREAD_ONCE_T_DEFINED -struct pthread_once_s; -typedef struct pthread_once_s pthread_once_t; -# define __PTHREAD_ONCE_T_DEFINED 1 -#endif - #endif /* __INCLUDE_PTHREAD_H */ diff --git a/include/signal.h b/include/signal.h index b63d77aa999..f3d9ccd165e 100644 --- a/include/signal.h +++ b/include/signal.h @@ -486,6 +486,11 @@ int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *value); int sigaltstack(FAR const stack_t *ss, FAR stack_t *oss); int siginterrupt(int signo, int flag); +/* Pthread signal management APIs */ + +int pthread_kill(pthread_t thread, int sig); +int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); + #undef EXTERN #ifdef __cplusplus } diff --git a/include/sys/types.h b/include/sys/types.h index e059ef20ab6..71636dd1a05 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -323,6 +323,51 @@ enum OK = 0 }; +#ifndef __PTHREAD_ATTR_T_DEFINED +struct pthread_attr_s; +typedef struct pthread_attr_s pthread_attr_t; +# define __PTHREAD_ATTR_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_COND_T_DEFINED +struct pthread_cond_s; +typedef struct pthread_cond_s pthread_cond_t; +# define __PTHREAD_COND_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_CONDATTR_T_DEFINED +typedef struct pthread_condattr_s pthread_condattr_t; +# define __PTHREAD_CONDATTR_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_KEY_T_DEFINED +typedef int pthread_key_t; +# define __PTHREAD_KEY_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_MUTEX_T_DEFINED +struct pthread_mutex_s; +typedef struct pthread_mutex_s pthread_mutex_t; +# define __PTHREAD_MUTEX_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_MUTEXATTR_T_DEFINED +struct pthread_mutexattr_s; +typedef struct pthread_mutexattr_s pthread_mutexattr_t; +# define __PTHREAD_MUTEXATTR_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_T_DEFINED +typedef pid_t pthread_t; +# define __PTHREAD_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_ONCE_T_DEFINED +struct pthread_once_s; +typedef struct pthread_once_s pthread_once_t; +# define __PTHREAD_ONCE_T_DEFINED 1 +#endif + /**************************************************************************** * Public Function Prototypes ****************************************************************************/