* include/pthread.h
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __INCLUDE_PTHREAD_H
#define __INCLUDE_PTHREAD_H
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <nuttx/mutex_type.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#ifdef CONFIG_PTHREAD_SPINLOCKS
* following:
*
* SP_LOCKED - A definition of the locked state value (usually 1)
* SP_UNLOCKED - A definition of the unlocked state value (usually 0)
* spinlock_t - The type of a spinlock memory object.
*
* SP_LOCKED and SP_UNLOCKED must constants of type spinlock_t.
*/
# include <nuttx/spinlock_type.h>
#endif
* Pre-processor Definitions
****************************************************************************/
#ifndef _POSIX_THREADS
# define _POSIX_THREADS
#endif
#ifndef _POSIX_THREAD_ATTR_STACKSIZE
# define _POSIX_THREAD_ATTR_STACKSIZE
#endif
#define PTHREAD_PROCESS_PRIVATE 0
#define PTHREAD_PROCESS_SHARED 1
*
* PTHREAD_MUTEX_NORMAL: This type of mutex does not detect deadlock.
* A thread attempting to relock this mutex without first unlocking
* it will deadlock. Attempting to unlock a mutex locked by a different
* thread results in undefined behavior. Attempting to unlock an unlocked
* mutex results in undefined behavior.
* PTHREAD_MUTEX_ERRORCHECK
* This type of mutex provides error checking. A thread attempting
* to relock this mutex without first unlocking it will return with
* an error. A thread attempting to unlock a mutex which another thread
* has locked will return with an error. A thread attempting to unlock
* an unlocked mutex will return with an error.
* PTHREAD_MUTEX_RECURSIVE
* A thread attempting to relock this mutex without first unlocking it will
* succeed in locking the mutex. The relocking deadlock which can occur
* with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this type
* of mutex. Multiple locks of this mutex require the same number
* of unlocks to release the mutex before another thread can acquire
* the mutex. A thread attempting to unlock a mutex which another thread
* has locked will return with an error. A thread attempting to unlock
* an unlocked mutex will return with an error.
* PTHREAD_MUTEX_DEFAULT
* An implementation is allowed to map this mutex to one of the other mutex
* types.
*/
#define PTHREAD_MUTEX_NORMAL 0
#define PTHREAD_MUTEX_ERRORCHECK 1
#define PTHREAD_MUTEX_RECURSIVE 2
#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
#define PTHREAD_STACK_MIN CONFIG_PTHREAD_STACK_MIN
#define PTHREAD_STACK_DEFAULT CONFIG_PTHREAD_STACK_DEFAULT
#define PTHREAD_GUARD_DEFAULT CONFIG_PTHREAD_GUARDSIZE_DEFAULT
#define PTHREAD_INHERIT_SCHED 0
#define PTHREAD_EXPLICIT_SCHED 1
#define PTHREAD_CREATE_JOINABLE 0
#define PTHREAD_CREATE_DETACHED 1
#define PTHREAD_DEFAULT_PRIORITY SCHED_PRIORITY_DEFAULT
#define PTHREAD_CANCEL_ENABLE (0)
#define PTHREAD_CANCEL_DISABLE (1)
#define PTHREAD_CANCEL_DEFERRED (0)
#define PTHREAD_CANCEL_ASYNCHRONOUS (1)
#define PTHREAD_CANCELED ((FAR void*)ERROR)
#define PTHREAD_ONCE_INIT {false, PTHREAD_MUTEX_INITIALIZER}
* in errno.h
*/
#define PTHREAD_BARRIER_SERIAL_THREAD 0x1000
#define PTHREAD_PRIO_NONE SEM_PRIO_NONE
#define PTHREAD_PRIO_INHERIT SEM_PRIO_INHERIT
#define PTHREAD_PRIO_PROTECT SEM_PRIO_PROTECT
*
* PTHREAD_MUTEX_STALLED - No special actions are taken if the owner of the
* mutex is terminated while holding the mutex lock. This can lead to
* deadlocks if no other thread can unlock the mutex. This is the standard
* default value (NuttX permits you to override that default behavior
* with a configuration option).
*
* PTHREAD_MUTEX_ROBUST - If the process containing the owning thread of a
* robust mutex terminates while holding the mutex lock, the next thread
* that acquires the mutex will be notified about the termination by the
* return value EOWNERDEAD from the locking function. If the owning thread
* of a robust mutex terminates while holding the mutex lock, the next
* thread that attempts to acquire the mutex may be notified about the
* termination by the return value EOWNERDEAD. The notified thread can
* then attempt to make the state protected by the mutex consistent again,
* and if successful can mark the mutex state as consistent by calling
* pthread_mutex_consistent(). After a subsequent successful call to
* pthread_mutex_unlock(), the mutex lock will be released and can be used
* normally by other threads. If the mutex is unlocked without a call to
* pthread_mutex_consistent(), it will be in a permanently unusable state
* and all attempts to lock the mutex will fail with the error
* ENOTRECOVERABLE. The only permissible operation on such a mutex is
* pthread_mutex_destroy().
*/
#define PTHREAD_MUTEX_STALLED 0
#define PTHREAD_MUTEX_ROBUST 1
* intended only for internal use within the OS.
*/
#define _PTHREAD_MFLAGS_ROBUST (1 << 0)
#define _PTHREAD_MFLAGS_INCONSISTENT (1 << 1)
#define _PTHREAD_MFLAGS_NRECOVERABLE (1 << 2)
#define PTHREAD_SCOPE_SYSTEM 0
#define PTHREAD_SCOPE_PROCESS 1
* Public Type Definitions
****************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif
#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
typedef pthread_startroutine_t pthread_func_t;
struct pthread_attr_s
{
int priority;
int policy;
int inheritsched;
uint8_t detachstate;
#ifdef CONFIG_SMP
cpu_set_t affinity;
#endif
FAR void *stackaddr;
size_t stacksize;
size_t guardsize;
#ifdef CONFIG_SCHED_SPORADIC
int low_priority;
uint8_t max_repl;
struct timespec repl_period;
struct timespec budget;
#endif
};
#ifndef __PTHREAD_ATTR_T_DEFINED
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
struct pthread_condattr_s
{
int pshared;
clockid_t clockid;
};
#ifndef __PTHREAD_CONDATTR_T_DEFINED
typedef struct pthread_condattr_s pthread_condattr_t;
# define __PTHREAD_CONDATTR_T_DEFINED 1
#endif
struct pthread_cond_s
{
sem_t sem;
clockid_t clockid;
uint16_t wait_count;
};
#ifndef __PTHREAD_COND_T_DEFINED
typedef struct pthread_cond_s pthread_cond_t;
# define __PTHREAD_COND_T_DEFINED 1
#endif
#define PTHREAD_COND_INITIALIZER {SEM_INITIALIZER(0), CLOCK_REALTIME }
struct pthread_mutexattr_s
{
uint8_t pshared : 1;
#if defined(CONFIG_PRIORITY_INHERITANCE) || defined(CONFIG_PRIORITY_PROTECT)
uint8_t prio : 2;
#endif
#ifdef CONFIG_PRIORITY_PROTECT
uint8_t ceiling;
#endif
#ifdef CONFIG_PTHREAD_MUTEX_TYPES
uint8_t type : 2;
#endif
#ifdef CONFIG_PTHREAD_MUTEX_BOTH
uint8_t robust : 1;
#endif
};
#ifndef __PTHREAD_MUTEXATTR_T_DEFINED
typedef struct pthread_mutexattr_s pthread_mutexattr_t;
# define __PTHREAD_MUTEXATTR_T_DEFINED 1
#endif
struct pthread_mutex_s
{
#ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
FAR struct pthread_mutex_s *flink;
uint8_t flags;
#endif
#ifdef CONFIG_PTHREAD_MUTEX_TYPES
uint8_t type;
rmutex_t mutex;
#else
mutex_t mutex;
#endif
};
#ifndef __PTHREAD_MUTEX_T_DEFINED
typedef struct pthread_mutex_s pthread_mutex_t;
# define __PTHREAD_MUTEX_T_DEFINED 1
#endif
#ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
# ifdef CONFIG_PTHREAD_MUTEX_DEFAULT_UNSAFE
# define __PTHREAD_MUTEX_DEFAULT_FLAGS 0
# else
# define __PTHREAD_MUTEX_DEFAULT_FLAGS _PTHREAD_MFLAGS_ROBUST
# endif
#endif
#ifdef CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT
# define PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT SEM_PRIO_INHERIT
#else
# define PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT 0
#endif
#ifdef CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_PROTECT
# define PTHREAD_MUTEX_DEFAULT_PRIO_PROTECT SEM_PRIO_PROTECT
#else
# define PTHREAD_MUTEX_DEFAULT_PRIO_PROTECT 0
#endif
#define PTHREAD_MUTEX_DEFAULT_PRIO_FLAGS (PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT | \
PTHREAD_MUTEX_DEFAULT_PRIO_PROTECT)
#define PTHREAD_NXMUTEX_INITIALIZER { \
NXSEM_INITIALIZER(NXSEM_NO_MHOLDER, \
SEM_TYPE_MUTEX | PTHREAD_MUTEX_DEFAULT_PRIO_FLAGS)}
#define PTHREAD_NXRMUTEX_INITIALIZER {PTHREAD_NXMUTEX_INITIALIZER, 0}
#if defined(CONFIG_PTHREAD_MUTEX_TYPES) && !defined(CONFIG_PTHREAD_MUTEX_UNSAFE)
# define PTHREAD_MUTEX_INITIALIZER {NULL, __PTHREAD_MUTEX_DEFAULT_FLAGS, \
PTHREAD_MUTEX_DEFAULT, \
PTHREAD_NXRMUTEX_INITIALIZER}
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
{NULL, __PTHREAD_MUTEX_DEFAULT_FLAGS, \
PTHREAD_MUTEX_RECURSIVE, \
PTHREAD_NXRMUTEX_INITIALIZER,}
#elif defined(CONFIG_PTHREAD_MUTEX_TYPES)
# define PTHREAD_MUTEX_INITIALIZER {PTHREAD_MUTEX_DEFAULT, \
PTHREAD_NXRMUTEX_INITIALIZER,}
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
{PTHREAD_MUTEX_RECURSIVE, \
PTHREAD_NXRMUTEX_INITIALIZER}
#elif !defined(CONFIG_PTHREAD_MUTEX_UNSAFE)
# define PTHREAD_MUTEX_INITIALIZER {NULL, __PTHREAD_MUTEX_DEFAULT_FLAGS,\
PTHREAD_NXMUTEX_INITIALIZER}
#else
# define PTHREAD_MUTEX_INITIALIZER {PTHREAD_NXMUTEX_INITIALIZER}
#endif
struct pthread_barrierattr_s
{
int pshared;
};
#ifndef __PTHREAD_BARRIERATTR_T_DEFINED
typedef struct pthread_barrierattr_s pthread_barrierattr_t;
# define __PTHREAD_BARRIERATTR_T_DEFINED 1
#endif
struct pthread_barrier_s
{
sem_t sem;
unsigned int count;
unsigned int wait_count;
mutex_t mutex;
};
#ifndef __PTHREAD_BARRIER_T_DEFINED
typedef struct pthread_barrier_s pthread_barrier_t;
# define __PTHREAD_BARRIER_T_DEFINED 1
#endif
struct pthread_once_s
{
volatile bool done;
pthread_mutex_t mutex;
};
#ifndef __PTHREAD_ONCE_T_DEFINED
typedef struct pthread_once_s pthread_once_t;
# define __PTHREAD_ONCE_T_DEFINED 1
#endif
struct pthread_rwlockattr_s
{
int pshared;
};
#ifndef __PTHREAD_RWLOCKATTR_T_DEFINED
typedef struct pthread_rwlockattr_s pthread_rwlockattr_t;
# define __PTHREAD_RWLOCKATTR_T_DEFINED 1
#endif
struct pthread_rwlock_s
{
pthread_mutex_t lock;
pthread_cond_t cv;
unsigned int num_readers;
unsigned int num_writers;
bool write_in_progress;
};
#ifndef __PTHREAD_RWLOCK_T_DEFINED
typedef struct pthread_rwlock_s pthread_rwlock_t;
# define __PTHREAD_RWLOCK_T_DEFINED 1
#endif
#define PTHREAD_RWLOCK_INITIALIZER {PTHREAD_MUTEX_INITIALIZER, \
PTHREAD_COND_INITIALIZER, \
0, 0, false}
#ifdef CONFIG_PTHREAD_SPINLOCKS
struct pthread_spinlock_s
{
volatile spinlock_t sp_lock;
* not. See the values SP_LOCKED and
* SP_UNLOCKED. */
pthread_t sp_holder;
};
# ifndef __PTHREAD_SPINLOCK_T_DEFINED
typedef FAR struct pthread_spinlock_s pthread_spinlock_t;
# define __PTHREAD_SPINLOCK_T_DEFINED 1
# endif
#endif
typedef CODE void (*pthread_cleanup_t)(FAR void *);
struct sched_param;
* Public Function Prototypes
****************************************************************************/
* for all of the individual attributes used by a given implementation.
*/
int pthread_attr_init(FAR pthread_attr_t *);
int pthread_attr_destroy(FAR pthread_attr_t *);
int pthread_attr_setschedpolicy(FAR pthread_attr_t *, int);
int pthread_attr_getschedpolicy(FAR const pthread_attr_t *,
FAR int *);
int pthread_attr_setschedparam(FAR pthread_attr_t *,
FAR const struct sched_param *);
int pthread_attr_getschedparam(FAR const pthread_attr_t *,
FAR struct sched_param *);
int pthread_attr_setinheritsched(FAR pthread_attr_t *,
int);
int pthread_attr_getinheritsched(FAR const pthread_attr_t *,
FAR int *);
int pthread_attr_getdetachstate(FAR const pthread_attr_t *,
FAR int *);
int pthread_attr_setdetachstate(FAR pthread_attr_t *,
int);
#ifdef CONFIG_SMP
int pthread_attr_setaffinity_np(FAR pthread_attr_t *,
size_t cpusetsize,
FAR const cpu_set_t *);
int pthread_attr_getaffinity_np(FAR const pthread_attr_t *,
size_t cpusetsize, cpu_set_t *);
#endif
int pthread_attr_setstackaddr(FAR pthread_attr_t *, FAR void *);
int pthread_attr_getstackaddr(FAR const pthread_attr_t *,
FAR void **);
int pthread_attr_setstacksize(FAR pthread_attr_t *, size_t);
int pthread_attr_getstacksize(FAR const pthread_attr_t *,
FAR size_t *);
int pthread_attr_setstack(FAR pthread_attr_t *,
FAR void *, size_t);
int pthread_attr_getstack(FAR const pthread_attr_t *,
FAR void **, FAR size_t *);
int pthread_attr_setscope(FAR pthread_attr_t *, int);
int pthread_attr_getscope(FAR const pthread_attr_t *, FAR int *);
int pthread_attr_setguardsize(FAR pthread_attr_t *, size_t);
int pthread_attr_getguardsize(FAR const pthread_attr_t *,
FAR size_t *);
int pthread_setname_np(pthread_t, FAR const char *);
int pthread_getname_np(pthread_t, FAR char *, size_t);
FAR void *pthread_get_stackaddr_np(pthread_t);
ssize_t pthread_get_stacksize_np(pthread_t);
* as the new thread's start routine. An argument may be passed to this
* routine, as an untyped address; an untyped address may also be returned as
* the routine's value. An attributes object may be used to specify details
* about the kind of thread being created.
*/
int pthread_create(FAR pthread_t *, FAR const pthread_attr_t *,
pthread_startroutine_t, pthread_addr_t);
* completion status will not be requested.
*/
int pthread_detach(pthread_t);
* thread.
*/
void pthread_exit(pthread_addr_t) noreturn_function;
int pthread_cancel(pthread_t);
int pthread_setcancelstate(int, FAR int *);
int pthread_setcanceltype(int, FAR int *);
void pthread_testcancel(void);
* is canceled.
*/
#if CONFIG_TLS_NCLEANUP > 0
void pthread_cleanup_pop(int);
void pthread_cleanup_push(pthread_cleanup_t, FAR void *);
#else
# define pthread_cleanup_pop(execute) ((void)(execute))
# define pthread_cleanup_push(routine,arg) ((void)(routine), (void)(arg))
#endif
* value of the thread.
*/
int pthread_join(pthread_t, FAR pthread_addr_t *);
* can be made available.
*/
void pthread_yield(void);
pthread_t pthread_self(void);
pid_t pthread_gettid_np(pthread_t);
int pthread_equal(pthread_t, pthread_t);
int pthread_getschedparam(pthread_t, FAR int *,
FAR struct sched_param *);
int pthread_setschedparam(pthread_t, int,
FAR const struct sched_param *);
int pthread_setschedprio(pthread_t, int);
#ifdef CONFIG_SMP
int pthread_setaffinity_np(pthread_t, size_t, FAR const cpu_set_t *);
int pthread_getaffinity_np(pthread_t, size_t, FAR cpu_set_t *);
#else
#define pthread_setaffinity_np(...) (-ENOSYS)
#define pthread_getaffinity_np(...) (-ENOSYS)
#endif
int pthread_setconcurrency(int);
int pthread_getconcurrency(void);
int pthread_key_create(FAR pthread_key_t *,
CODE void (*)(FAR void *));
int pthread_setspecific(pthread_key_t, FAR const void *);
FAR void *pthread_getspecific(pthread_key_t);
int pthread_key_delete(pthread_key_t);
int pthread_mutexattr_init(FAR pthread_mutexattr_t *);
int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *);
int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *,
FAR int *);
int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *,
int);
int pthread_mutexattr_gettype(FAR const pthread_mutexattr_t *,
FAR int *);
int pthread_mutexattr_settype(FAR pthread_mutexattr_t *, int);
int pthread_mutexattr_getprotocol(FAR const pthread_mutexattr_t *,
FAR int *);
int pthread_mutexattr_setprotocol(FAR pthread_mutexattr_t *,
int);
int pthread_mutexattr_getrobust(FAR const pthread_mutexattr_t *,
FAR int *);
int pthread_mutexattr_setrobust(FAR pthread_mutexattr_t *,
int);
int pthread_mutexattr_getprioceiling(FAR const pthread_mutexattr_t *,
FAR int *);
int pthread_mutexattr_setprioceiling(FAR pthread_mutexattr_t *,
int);
int pthread_mutex_getprioceiling(FAR const pthread_mutex_t *,
FAR int *);
int pthread_mutex_setprioceiling(FAR pthread_mutex_t *,
int, FAR int *);
int pthread_mutex_init(FAR pthread_mutex_t *,
FAR const pthread_mutexattr_t *);
int pthread_mutex_destroy(FAR pthread_mutex_t *);
int pthread_mutex_lock(FAR pthread_mutex_t *);
int pthread_mutex_timedlock(FAR pthread_mutex_t *,
FAR const struct timespec *);
int pthread_mutex_trylock(FAR pthread_mutex_t *);
int pthread_mutex_unlock(FAR pthread_mutex_t *);
#ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
int pthread_mutex_consistent(FAR pthread_mutex_t *);
#endif
int pthread_condattr_init(FAR pthread_condattr_t *);
int pthread_condattr_destroy(FAR pthread_condattr_t *);
int pthread_condattr_getpshared(FAR const pthread_condattr_t *,
FAR int *);
int pthread_condattr_setpshared(FAR pthread_condattr_t *, int);
int pthread_condattr_getclock(FAR const pthread_condattr_t *,
clockid_t *);
int pthread_condattr_setclock(FAR pthread_condattr_t *,
clockid_t);
int pthread_cond_init(FAR pthread_cond_t *,
FAR const pthread_condattr_t *);
int pthread_cond_destroy(FAR pthread_cond_t *);
int pthread_cond_broadcast(FAR pthread_cond_t *);
int pthread_cond_signal(FAR pthread_cond_t *);
int pthread_cond_wait(FAR pthread_cond_t *, FAR pthread_mutex_t *);
int pthread_cond_timedwait(FAR pthread_cond_t *,
FAR pthread_mutex_t *,
FAR const struct timespec *);
int pthread_cond_clockwait(FAR pthread_cond_t *,
FAR pthread_mutex_t *,
clockid_t,
FAR const struct timespec *);
int pthread_barrierattr_destroy(FAR pthread_barrierattr_t *);
int pthread_barrierattr_init(FAR pthread_barrierattr_t *);
int pthread_barrierattr_getpshared(FAR const pthread_barrierattr_t *,
FAR int *);
int pthread_barrierattr_setpshared(FAR pthread_barrierattr_t *,
int);
int pthread_barrier_destroy(FAR pthread_barrier_t *);
int pthread_barrier_init(FAR pthread_barrier_t *,
FAR const pthread_barrierattr_t *,
unsigned int);
int pthread_barrier_wait(FAR pthread_barrier_t *);
int pthread_once(FAR pthread_once_t *,
CODE void (*)(void));
int pthread_rwlockattr_init(FAR pthread_rwlockattr_t *);
int pthread_rwlockattr_destroy(FAR pthread_rwlockattr_t *);
int pthread_rwlockattr_getpshared(FAR const pthread_rwlockattr_t *,
FAR int *);
int pthread_rwlockattr_setpshared(FAR pthread_rwlockattr_t *,
int);
int pthread_rwlock_destroy(FAR pthread_rwlock_t *);
int pthread_rwlock_init(FAR pthread_rwlock_t *,
FAR const pthread_rwlockattr_t *);
int pthread_rwlock_rdlock(pthread_rwlock_t *);
int pthread_rwlock_timedrdlock(FAR pthread_rwlock_t *,
FAR const struct timespec *);
int pthread_rwlock_clockrdlock(FAR pthread_rwlock_t *,
clockid_t,
FAR const struct timespec *);
int pthread_rwlock_tryrdlock(FAR pthread_rwlock_t *);
int pthread_rwlock_wrlock(FAR pthread_rwlock_t *);
int pthread_rwlock_timedwrlock(FAR pthread_rwlock_t *,
FAR const struct timespec *);
int pthread_rwlock_clockwrlock(FAR pthread_rwlock_t *,
clockid_t,
FAR const struct timespec *);
int pthread_rwlock_trywrlock(FAR pthread_rwlock_t *);
int pthread_rwlock_unlock(FAR pthread_rwlock_t *);
#ifdef CONFIG_PTHREAD_SPINLOCKS
int pthread_spin_init(FAR pthread_spinlock_t *, int);
int pthread_spin_destroy(FAR pthread_spinlock_t *);
int pthread_spin_lock(FAR pthread_spinlock_t *);
int pthread_spin_trylock(FAR pthread_spinlock_t *);
int pthread_spin_unlock(FAR pthread_spinlock_t *);
#endif
int pthread_getcpuclockid(pthread_t, FAR clockid_t *);
int pthread_atfork(CODE void (*)(void),
CODE void (*)(void),
CODE void (*)(void));
#ifdef __cplusplus
}
#endif
* Minimal Type Definitions
****************************************************************************/
#else
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdbool.h>
* Public Type Definitions
****************************************************************************/
* available in any inclusion ordering.
*/
#ifndef __PTHREAD_ADDR_T_DEFINED
typedef FAR void *pthread_addr_t;
# define __PTHREAD_ADDR_T_DEFINED 1
#endif
#ifndef __PTHREAD_BARRIERATTR_T_DEFINED
struct pthread_barrierattr_s;
typedef struct pthread_barrierattr_s pthread_barrierattr_t;
# define __PTHREAD_BARRIERATTR_T_DEFINED 1
#endif
#ifndef __PTHREAD_BARRIER_T_DEFINED
struct pthread_barrier_s;
typedef struct pthread_barrier_s pthread_barrier_t;
# define __PTHREAD_BARRIER_T_DEFINED 1
#endif
#ifndef __PTHREAD_RWLOCKATTR_T_DEFINED
struct pthread_rwlockattr_s;
typedef struct pthread_rwlockattr_s pthread_rwlockattr_t;
# define __PTHREAD_RWLOCKATTR_T_DEFINED 1
#endif
#ifndef __PTHREAD_RWLOCK_T_DEFINED
struct pthread_rwlock_s;
typedef struct pthread_rwlock_s pthread_rwlock_t;
# define __PTHREAD_RWLOCK_T_DEFINED 1
#endif
#ifdef CONFIG_PTHREAD_SPINLOCKS
# ifndef __PTHREAD_SPINLOCK_T_DEFINED
struct pthread_spinlock_s;
typedef FAR struct pthread_spinlock_s pthread_spinlock_t;
# define __PTHREAD_SPINLOCK_T_DEFINED 1
# endif
#endif
#endif