pthread.h: drop nullability attributes.
These have been found to be practically useless. We were actually following the Android bionic library and had some interest in replicating the same warnings and behaviour but Android has since removed them. We are still keeping some uses of nullability attributes in other headers, somewhat in line with Apple's libc. MFC after: 1 week Hinted by: bionic (git 3f66e74b903905e763e104396aff52a81718cfde)
This commit is contained in:
parent
de14bffe33
commit
7a07ca9b3c
@ -48,8 +48,6 @@
|
||||
#include <sched.h>
|
||||
#include <time.h>
|
||||
|
||||
__NULLABILITY_PRAGMA_PUSH
|
||||
|
||||
/*
|
||||
* Run-time invariant values:
|
||||
*/
|
||||
@ -151,34 +149,33 @@ struct _pthread_cleanup_info {
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
int pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
|
||||
int pthread_attr_destroy(pthread_attr_t * _Nonnull);
|
||||
int pthread_attr_destroy(pthread_attr_t *);
|
||||
int pthread_attr_getstack(
|
||||
const pthread_attr_t * _Nonnull __restrict,
|
||||
void ** _Nonnull __restrict,
|
||||
size_t * _Nonnull __restrict);
|
||||
int pthread_attr_getstacksize(const pthread_attr_t * _Nonnull,
|
||||
size_t * _Nonnull);
|
||||
int pthread_attr_getguardsize(const pthread_attr_t * _Nonnull,
|
||||
size_t * _Nonnull);
|
||||
const pthread_attr_t * __restrict, void ** __restrict,
|
||||
size_t * __restrict);
|
||||
int pthread_attr_getstacksize(const pthread_attr_t *,
|
||||
size_t *);
|
||||
int pthread_attr_getguardsize(const pthread_attr_t *,
|
||||
size_t *);
|
||||
int pthread_attr_getstackaddr(const pthread_attr_t *, void **);
|
||||
int pthread_attr_getdetachstate(const pthread_attr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_attr_init(pthread_attr_t * _Nonnull);
|
||||
int pthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t);
|
||||
int pthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t);
|
||||
int pthread_attr_setstack(pthread_attr_t * _Nonnull, void *,
|
||||
int pthread_attr_getdetachstate(const pthread_attr_t *,
|
||||
int *);
|
||||
int pthread_attr_init(pthread_attr_t *);
|
||||
int pthread_attr_setstacksize(pthread_attr_t *, size_t);
|
||||
int pthread_attr_setguardsize(pthread_attr_t *, size_t);
|
||||
int pthread_attr_setstack(pthread_attr_t *, void *,
|
||||
size_t);
|
||||
int pthread_attr_setstackaddr(pthread_attr_t *, void *);
|
||||
int pthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int);
|
||||
int pthread_barrier_destroy(pthread_barrier_t * _Nonnull);
|
||||
int pthread_barrier_init(pthread_barrier_t * _Nonnull,
|
||||
int pthread_attr_setdetachstate(pthread_attr_t *, int);
|
||||
int pthread_barrier_destroy(pthread_barrier_t *);
|
||||
int pthread_barrier_init(pthread_barrier_t *,
|
||||
const pthread_barrierattr_t *, unsigned);
|
||||
int pthread_barrier_wait(pthread_barrier_t * _Nonnull);
|
||||
int pthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull);
|
||||
int pthread_barrier_wait(pthread_barrier_t *);
|
||||
int pthread_barrierattr_destroy(pthread_barrierattr_t *);
|
||||
int pthread_barrierattr_getpshared(
|
||||
const pthread_barrierattr_t * _Nonnull, int * _Nonnull);
|
||||
int pthread_barrierattr_init(pthread_barrierattr_t * _Nonnull);
|
||||
int pthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull,
|
||||
const pthread_barrierattr_t *, int *);
|
||||
int pthread_barrierattr_init(pthread_barrierattr_t *);
|
||||
int pthread_barrierattr_setpshared(pthread_barrierattr_t *,
|
||||
int);
|
||||
|
||||
#define pthread_cleanup_push(cleanup_routine, cleanup_arg) \
|
||||
@ -194,108 +191,107 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull,
|
||||
__pthread_cleanup_pop_imp(execute); \
|
||||
}
|
||||
|
||||
int pthread_condattr_destroy(pthread_condattr_t * _Nonnull);
|
||||
int pthread_condattr_getclock(const pthread_condattr_t * _Nonnull,
|
||||
clockid_t * _Nonnull);
|
||||
int pthread_condattr_getpshared(const pthread_condattr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_condattr_init(pthread_condattr_t * _Nonnull);
|
||||
int pthread_condattr_setclock(pthread_condattr_t * _Nonnull,
|
||||
int pthread_condattr_destroy(pthread_condattr_t *);
|
||||
int pthread_condattr_getclock(const pthread_condattr_t *,
|
||||
clockid_t *);
|
||||
int pthread_condattr_getpshared(const pthread_condattr_t *,
|
||||
int *);
|
||||
int pthread_condattr_init(pthread_condattr_t *);
|
||||
int pthread_condattr_setclock(pthread_condattr_t *,
|
||||
clockid_t);
|
||||
int pthread_condattr_setpshared(pthread_condattr_t * _Nonnull, int);
|
||||
int pthread_cond_broadcast(pthread_cond_t * _Nonnull);
|
||||
int pthread_cond_destroy(pthread_cond_t * _Nonnull);
|
||||
int pthread_cond_init(pthread_cond_t * _Nonnull,
|
||||
int pthread_condattr_setpshared(pthread_condattr_t *, int);
|
||||
int pthread_cond_broadcast(pthread_cond_t *);
|
||||
int pthread_cond_destroy(pthread_cond_t *);
|
||||
int pthread_cond_init(pthread_cond_t *,
|
||||
const pthread_condattr_t *);
|
||||
int pthread_cond_signal(pthread_cond_t * _Nonnull);
|
||||
int pthread_cond_timedwait(pthread_cond_t * _Nonnull,
|
||||
pthread_mutex_t * _Nonnull __mutex,
|
||||
const struct timespec * _Nonnull)
|
||||
int pthread_cond_signal(pthread_cond_t *);
|
||||
int pthread_cond_timedwait(pthread_cond_t *,
|
||||
pthread_mutex_t * __mutex,
|
||||
const struct timespec *)
|
||||
__requires_exclusive(*__mutex);
|
||||
int pthread_cond_wait(pthread_cond_t * _Nonnull,
|
||||
pthread_mutex_t * _Nonnull __mutex)
|
||||
int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * __mutex)
|
||||
__requires_exclusive(*__mutex);
|
||||
int pthread_create(pthread_t * _Nonnull, const pthread_attr_t *,
|
||||
void *(* _Nonnull) (void *), void *);
|
||||
int pthread_create(pthread_t *, const pthread_attr_t *,
|
||||
void *(*) (void *), void *);
|
||||
int pthread_detach(pthread_t);
|
||||
int pthread_equal(pthread_t, pthread_t);
|
||||
void pthread_exit(void *) __dead2;
|
||||
void *pthread_getspecific(pthread_key_t);
|
||||
int pthread_getcpuclockid(pthread_t, clockid_t * _Nonnull);
|
||||
int pthread_getcpuclockid(pthread_t, clockid_t *);
|
||||
int pthread_join(pthread_t, void **);
|
||||
int pthread_key_create(pthread_key_t * _Nonnull,
|
||||
int pthread_key_create(pthread_key_t *,
|
||||
void (*) (void *));
|
||||
int pthread_key_delete(pthread_key_t);
|
||||
int pthread_mutexattr_init(pthread_mutexattr_t * _Nonnull);
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t * _Nonnull);
|
||||
int pthread_mutexattr_init(pthread_mutexattr_t *);
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t *);
|
||||
int pthread_mutexattr_getpshared(
|
||||
const pthread_mutexattr_t * _Nonnull, int * _Nonnull);
|
||||
int pthread_mutexattr_gettype(pthread_mutexattr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t * _Nonnull, int);
|
||||
int pthread_mutexattr_setpshared(pthread_mutexattr_t * _Nonnull,
|
||||
const pthread_mutexattr_t *, int *);
|
||||
int pthread_mutexattr_gettype(pthread_mutexattr_t *,
|
||||
int *);
|
||||
int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
|
||||
int pthread_mutexattr_setpshared(pthread_mutexattr_t *,
|
||||
int);
|
||||
int pthread_mutex_consistent(pthread_mutex_t * _Nonnull __mutex)
|
||||
int pthread_mutex_consistent(pthread_mutex_t * __mutex)
|
||||
__requires_exclusive(*__mutex);
|
||||
int pthread_mutex_destroy(pthread_mutex_t * _Nonnull __mutex)
|
||||
int pthread_mutex_destroy(pthread_mutex_t * __mutex)
|
||||
__requires_unlocked(*__mutex);
|
||||
int pthread_mutex_init(pthread_mutex_t * _Nonnull __mutex,
|
||||
int pthread_mutex_init(pthread_mutex_t * __mutex,
|
||||
const pthread_mutexattr_t *)
|
||||
__requires_unlocked(*__mutex);
|
||||
int pthread_mutex_lock(pthread_mutex_t * _Nonnull __mutex)
|
||||
int pthread_mutex_lock(pthread_mutex_t * __mutex)
|
||||
__locks_exclusive(*__mutex);
|
||||
int pthread_mutex_trylock(pthread_mutex_t * _Nonnull __mutex)
|
||||
int pthread_mutex_trylock(pthread_mutex_t * __mutex)
|
||||
__trylocks_exclusive(0, *__mutex);
|
||||
int pthread_mutex_timedlock(pthread_mutex_t * _Nonnull __mutex,
|
||||
const struct timespec * _Nonnull)
|
||||
int pthread_mutex_timedlock(pthread_mutex_t * __mutex,
|
||||
const struct timespec *)
|
||||
__trylocks_exclusive(0, *__mutex);
|
||||
int pthread_mutex_unlock(pthread_mutex_t * _Nonnull __mutex)
|
||||
int pthread_mutex_unlock(pthread_mutex_t * __mutex)
|
||||
__unlocks(*__mutex);
|
||||
int pthread_once(pthread_once_t * _Nonnull,
|
||||
void (* _Nonnull) (void));
|
||||
int pthread_rwlock_destroy(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
int pthread_once(pthread_once_t *,
|
||||
void (*) (void));
|
||||
int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock)
|
||||
__requires_unlocked(*__rwlock);
|
||||
int pthread_rwlock_init(pthread_rwlock_t * _Nonnull __rwlock,
|
||||
int pthread_rwlock_init(pthread_rwlock_t * __rwlock,
|
||||
const pthread_rwlockattr_t *)
|
||||
__requires_unlocked(*__rwlock);
|
||||
int pthread_rwlock_rdlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock)
|
||||
__locks_shared(*__rwlock);
|
||||
int pthread_rwlock_timedrdlock(pthread_rwlock_t * _Nonnull __rwlock,
|
||||
const struct timespec * _Nonnull)
|
||||
int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock,
|
||||
const struct timespec *)
|
||||
__trylocks_shared(0, *__rwlock);
|
||||
int pthread_rwlock_timedwrlock(pthread_rwlock_t * _Nonnull __rwlock,
|
||||
const struct timespec * _Nonnull)
|
||||
int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock,
|
||||
const struct timespec *)
|
||||
__trylocks_exclusive(0, *__rwlock);
|
||||
int pthread_rwlock_tryrdlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock)
|
||||
__trylocks_shared(0, *__rwlock);
|
||||
int pthread_rwlock_trywrlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock)
|
||||
__trylocks_exclusive(0, *__rwlock);
|
||||
int pthread_rwlock_unlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock)
|
||||
__unlocks(*__rwlock);
|
||||
int pthread_rwlock_wrlock(pthread_rwlock_t * _Nonnull __rwlock)
|
||||
int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock)
|
||||
__locks_exclusive(*__rwlock);
|
||||
int pthread_rwlockattr_destroy(pthread_rwlockattr_t * _Nonnull);
|
||||
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
|
||||
int pthread_rwlockattr_getkind_np(
|
||||
const pthread_rwlockattr_t * _Nonnull, int *);
|
||||
const pthread_rwlockattr_t *, int *);
|
||||
int pthread_rwlockattr_getpshared(
|
||||
const pthread_rwlockattr_t * _Nonnull, int * _Nonnull);
|
||||
int pthread_rwlockattr_init(pthread_rwlockattr_t * _Nonnull);
|
||||
int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * _Nonnull,
|
||||
const pthread_rwlockattr_t *, int *);
|
||||
int pthread_rwlockattr_init(pthread_rwlockattr_t *);
|
||||
int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *,
|
||||
int);
|
||||
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * _Nonnull,
|
||||
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *,
|
||||
int);
|
||||
pthread_t pthread_self(void);
|
||||
int pthread_setspecific(pthread_key_t, const void *);
|
||||
|
||||
int pthread_spin_init(pthread_spinlock_t * _Nonnull __spin, int)
|
||||
int pthread_spin_init(pthread_spinlock_t * __spin, int)
|
||||
__requires_unlocked(*__spin);
|
||||
int pthread_spin_destroy(pthread_spinlock_t * _Nonnull __spin)
|
||||
int pthread_spin_destroy(pthread_spinlock_t * __spin)
|
||||
__requires_unlocked(*__spin);
|
||||
int pthread_spin_lock(pthread_spinlock_t * _Nonnull __spin)
|
||||
int pthread_spin_lock(pthread_spinlock_t * __spin)
|
||||
__locks_exclusive(*__spin);
|
||||
int pthread_spin_trylock(pthread_spinlock_t * _Nonnull __spin)
|
||||
int pthread_spin_trylock(pthread_spinlock_t * __spin)
|
||||
__trylocks_exclusive(0, *__spin);
|
||||
int pthread_spin_unlock(pthread_spinlock_t * _Nonnull __spin)
|
||||
int pthread_spin_unlock(pthread_spinlock_t * __spin)
|
||||
__unlocks(*__spin);
|
||||
int pthread_cancel(pthread_t);
|
||||
int pthread_setcancelstate(int, int *);
|
||||
@ -317,27 +313,26 @@ int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *);
|
||||
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
|
||||
|
||||
int pthread_mutexattr_getrobust(
|
||||
pthread_mutexattr_t * _Nonnull __restrict,
|
||||
int * _Nonnull __restrict);
|
||||
int pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull,
|
||||
pthread_mutexattr_t * __restrict, int * __restrict);
|
||||
int pthread_mutexattr_setrobust(pthread_mutexattr_t *,
|
||||
int);
|
||||
|
||||
int pthread_attr_getinheritsched(const pthread_attr_t *, int *);
|
||||
int pthread_attr_getschedparam(const pthread_attr_t * _Nonnull,
|
||||
struct sched_param * _Nonnull);
|
||||
int pthread_attr_getschedpolicy(const pthread_attr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_attr_getscope(const pthread_attr_t * _Nonnull,
|
||||
int * _Nonnull);
|
||||
int pthread_attr_getschedparam(const pthread_attr_t *,
|
||||
struct sched_param *);
|
||||
int pthread_attr_getschedpolicy(const pthread_attr_t *,
|
||||
int *);
|
||||
int pthread_attr_getscope(const pthread_attr_t *,
|
||||
int *);
|
||||
int pthread_attr_setinheritsched(pthread_attr_t *, int);
|
||||
int pthread_attr_setschedparam(pthread_attr_t * _Nonnull,
|
||||
const struct sched_param * _Nonnull);
|
||||
int pthread_attr_setschedpolicy(pthread_attr_t * _Nonnull, int);
|
||||
int pthread_attr_setscope(pthread_attr_t * _Nonnull, int);
|
||||
int pthread_getschedparam(pthread_t pthread, int * _Nonnull,
|
||||
struct sched_param * _Nonnull);
|
||||
int pthread_attr_setschedparam(pthread_attr_t *,
|
||||
const struct sched_param *);
|
||||
int pthread_attr_setschedpolicy(pthread_attr_t *, int);
|
||||
int pthread_attr_setscope(pthread_attr_t *, int);
|
||||
int pthread_getschedparam(pthread_t pthread, int *,
|
||||
struct sched_param *);
|
||||
int pthread_setschedparam(pthread_t, int,
|
||||
const struct sched_param * _Nonnull);
|
||||
const struct sched_param *);
|
||||
#if __XSI_VISIBLE
|
||||
int pthread_getconcurrency(void);
|
||||
int pthread_setconcurrency(int);
|
||||
@ -347,6 +342,5 @@ void __pthread_cleanup_push_imp(void (*)(void *), void *,
|
||||
struct _pthread_cleanup_info *);
|
||||
void __pthread_cleanup_pop_imp(int);
|
||||
__END_DECLS
|
||||
__NULLABILITY_PRAGMA_POP
|
||||
|
||||
#endif /* !_PTHREAD_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user