Lines Matching refs:attr

72 static inline __always_inline __always_inline bool __rwlockattr_getpshared(const pthread_rwlockattr_t* attr) {
73 return (*attr & RWLOCKATTR_PSHARED_MASK) >> RWLOCKATTR_PSHARED_SHIFT;
76 static inline __always_inline __always_inline void __rwlockattr_setpshared(pthread_rwlockattr_t* attr, int pshared) {
77 *attr = (*attr & ~RWLOCKATTR_PSHARED_MASK) | (pshared << RWLOCKATTR_PSHARED_SHIFT);
80 static inline __always_inline int __rwlockattr_getkind(const pthread_rwlockattr_t* attr) {
81 return (*attr & RWLOCKATTR_KIND_MASK) >> RWLOCKATTR_KIND_SHIFT;
84 static inline __always_inline void __rwlockattr_setkind(pthread_rwlockattr_t* attr, int kind) {
85 *attr = (*attr & ~RWLOCKATTR_KIND_MASK) | (kind << RWLOCKATTR_KIND_SHIFT);
89 int pthread_rwlockattr_init(pthread_rwlockattr_t* attr) {
90 *attr = 0;
94 int pthread_rwlockattr_destroy(pthread_rwlockattr_t* attr) {
95 *attr = -1;
99 int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t* attr, int* pshared) {
100 if (__rwlockattr_getpshared(attr)) {
108 int pthread_rwlockattr_setpshared(pthread_rwlockattr_t* attr, int pshared) {
111 __rwlockattr_setpshared(attr, 0);
114 __rwlockattr_setpshared(attr, 1);
121 int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t* attr, int* pref) {
122 *pref = __rwlockattr_getkind(attr);
126 int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t* attr, int pref) {
130 __rwlockattr_setkind(attr, pref);
226 int pthread_rwlock_init(pthread_rwlock_t* rwlock_interface, const pthread_rwlockattr_t* attr) {
231 if (__predict_false(attr != NULL)) {
232 rwlock->pshared = __rwlockattr_getpshared(attr);
233 int kind = __rwlockattr_getkind(attr);
244 if ((*attr & RWLOCKATTR_RESERVED_MASK) != 0) {