diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-07-22 13:57:02 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-07-22 13:57:02 -0400 |
commit | 0109d950e685f1c5f6cef245a8b1bc47c9b6d94c (patch) | |
tree | a4048fa32a9e4337e524e0323cc5cc2e9ce8367d /src/thread | |
parent | c4dd0c98bae8e3583f68ba5b30db491055ab2322 (diff) | |
download | musl-0109d950e685f1c5f6cef245a8b1bc47c9b6d94c.tar.gz musl-0109d950e685f1c5f6cef245a8b1bc47c9b6d94c.tar.bz2 musl-0109d950e685f1c5f6cef245a8b1bc47c9b6d94c.tar.xz musl-0109d950e685f1c5f6cef245a8b1bc47c9b6d94c.zip |
make pthread attribute types structs, even when they just have one field
this change is to get the right tags for C++ ABI matching. it should
have no other effects.
Diffstat (limited to 'src/thread')
-rw-r--r-- | src/thread/pthread_attr_get.c | 14 | ||||
-rw-r--r-- | src/thread/pthread_barrier_init.c | 2 | ||||
-rw-r--r-- | src/thread/pthread_barrierattr_setpshared.c | 2 | ||||
-rw-r--r-- | src/thread/pthread_cond_init.c | 4 | ||||
-rw-r--r-- | src/thread/pthread_condattr_setclock.c | 4 | ||||
-rw-r--r-- | src/thread/pthread_condattr_setpshared.c | 4 | ||||
-rw-r--r-- | src/thread/pthread_mutex_init.c | 2 | ||||
-rw-r--r-- | src/thread/pthread_mutexattr_setpshared.c | 4 | ||||
-rw-r--r-- | src/thread/pthread_mutexattr_setrobust.c | 4 | ||||
-rw-r--r-- | src/thread/pthread_mutexattr_settype.c | 2 | ||||
-rw-r--r-- | src/thread/pthread_rwlockattr_setpshared.c | 2 |
11 files changed, 22 insertions, 22 deletions
diff --git a/src/thread/pthread_attr_get.c b/src/thread/pthread_attr_get.c index ad913c5a..03fc91e3 100644 --- a/src/thread/pthread_attr_get.c +++ b/src/thread/pthread_attr_get.c @@ -52,19 +52,19 @@ int pthread_attr_getstacksize(const pthread_attr_t *restrict a, size_t *restrict int pthread_barrierattr_getpshared(const pthread_barrierattr_t *restrict a, int *restrict pshared) { - *pshared = !!*a; + *pshared = !!a->__attr; return 0; } int pthread_condattr_getclock(const pthread_condattr_t *restrict a, clockid_t *restrict clk) { - *clk = *a & 0x7fffffff; + *clk = a->__attr & 0x7fffffff; return 0; } int pthread_condattr_getpshared(const pthread_condattr_t *restrict a, int *restrict pshared) { - *pshared = *a>>31; + *pshared = a->__attr>>31; return 0; } @@ -75,24 +75,24 @@ int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *re } int pthread_mutexattr_getpshared(const pthread_mutexattr_t *restrict a, int *restrict pshared) { - *pshared = *a>>31; + *pshared = a->__attr>>31; return 0; } int pthread_mutexattr_getrobust(const pthread_mutexattr_t *restrict a, int *restrict robust) { - *robust = *a / 4U % 2; + *robust = a->__attr / 4U % 2; return 0; } int pthread_mutexattr_gettype(const pthread_mutexattr_t *restrict a, int *restrict type) { - *type = *a & 3; + *type = a->__attr & 3; return 0; } int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *restrict a, int *restrict pshared) { - *pshared = *(int *)a; + *pshared = a->__attr[0]; return 0; } diff --git a/src/thread/pthread_barrier_init.c b/src/thread/pthread_barrier_init.c index 01e8cd6b..4c3cb28d 100644 --- a/src/thread/pthread_barrier_init.c +++ b/src/thread/pthread_barrier_init.c @@ -3,6 +3,6 @@ int pthread_barrier_init(pthread_barrier_t *restrict b, const pthread_barrierattr_t *restrict a, unsigned count) { if (count-1 > INT_MAX-1) return EINVAL; - *b = (pthread_barrier_t){ ._b_limit = count-1 | (a?*a:0) }; + *b = (pthread_barrier_t){ ._b_limit = count-1 | (a?a->__attr:0) }; return 0; } diff --git a/src/thread/pthread_barrierattr_setpshared.c b/src/thread/pthread_barrierattr_setpshared.c index 1edc95dc..b391461e 100644 --- a/src/thread/pthread_barrierattr_setpshared.c +++ b/src/thread/pthread_barrierattr_setpshared.c @@ -2,6 +2,6 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *a, int pshared) { - *a = pshared ? INT_MIN : 0; + a->__attr = pshared ? INT_MIN : 0; return 0; } diff --git a/src/thread/pthread_cond_init.c b/src/thread/pthread_cond_init.c index 71489bca..357ecd55 100644 --- a/src/thread/pthread_cond_init.c +++ b/src/thread/pthread_cond_init.c @@ -4,8 +4,8 @@ int pthread_cond_init(pthread_cond_t *restrict c, const pthread_condattr_t *rest { *c = (pthread_cond_t){0}; if (a) { - c->_c_clock = *a & 0x7fffffff; - if (*a>>31) c->_c_mutex = (void *)-1; + c->_c_clock = a->__attr & 0x7fffffff; + if (a->__attr>>31) c->_c_mutex = (void *)-1; } return 0; } diff --git a/src/thread/pthread_condattr_setclock.c b/src/thread/pthread_condattr_setclock.c index cd2cecc9..71125941 100644 --- a/src/thread/pthread_condattr_setclock.c +++ b/src/thread/pthread_condattr_setclock.c @@ -3,7 +3,7 @@ int pthread_condattr_setclock(pthread_condattr_t *a, clockid_t clk) { if (clk < 0 || clk-2U < 2) return EINVAL; - *a &= 0x80000000; - *a |= clk; + a->__attr &= 0x80000000; + a->__attr |= clk; return 0; } diff --git a/src/thread/pthread_condattr_setpshared.c b/src/thread/pthread_condattr_setpshared.c index c0cc1ef9..bece8a26 100644 --- a/src/thread/pthread_condattr_setpshared.c +++ b/src/thread/pthread_condattr_setpshared.c @@ -3,7 +3,7 @@ int pthread_condattr_setpshared(pthread_condattr_t *a, int pshared) { if (pshared > 1U) return EINVAL; - *a &= 0x7fffffff; - *a |= pshared<<31; + a->__attr &= 0x7fffffff; + a->__attr |= pshared<<31; return 0; } diff --git a/src/thread/pthread_mutex_init.c b/src/thread/pthread_mutex_init.c index a7ba39ba..9d85a354 100644 --- a/src/thread/pthread_mutex_init.c +++ b/src/thread/pthread_mutex_init.c @@ -3,6 +3,6 @@ int pthread_mutex_init(pthread_mutex_t *restrict m, const pthread_mutexattr_t *restrict a) { *m = (pthread_mutex_t){0}; - if (a) m->_m_type = *a & 7; + if (a) m->_m_type = a->__attr & 7; return 0; } diff --git a/src/thread/pthread_mutexattr_setpshared.c b/src/thread/pthread_mutexattr_setpshared.c index 1a26001a..8c7a1e26 100644 --- a/src/thread/pthread_mutexattr_setpshared.c +++ b/src/thread/pthread_mutexattr_setpshared.c @@ -3,7 +3,7 @@ int pthread_mutexattr_setpshared(pthread_mutexattr_t *a, int pshared) { if (pshared > 1U) return EINVAL; - *a &= 0x7fffffff; - *a |= pshared<<31; + a->__attr &= 0x7fffffff; + a->__attr |= pshared<<31; return 0; } diff --git a/src/thread/pthread_mutexattr_setrobust.c b/src/thread/pthread_mutexattr_setrobust.c index 4a296ba1..dcfa4cf1 100644 --- a/src/thread/pthread_mutexattr_setrobust.c +++ b/src/thread/pthread_mutexattr_setrobust.c @@ -3,7 +3,7 @@ int pthread_mutexattr_setrobust(pthread_mutexattr_t *a, int robust) { if (robust > 1U) return EINVAL; - *a &= ~4; - *a |= robust*4; + a->__attr &= ~4; + a->__attr |= robust*4; return 0; } diff --git a/src/thread/pthread_mutexattr_settype.c b/src/thread/pthread_mutexattr_settype.c index 4e85950e..cd7a80e3 100644 --- a/src/thread/pthread_mutexattr_settype.c +++ b/src/thread/pthread_mutexattr_settype.c @@ -3,6 +3,6 @@ int pthread_mutexattr_settype(pthread_mutexattr_t *a, int type) { if ((unsigned)type > 2) return EINVAL; - *a = (*a & ~3) | type; + a->__attr = (a->__attr & ~3) | type; return 0; } diff --git a/src/thread/pthread_rwlockattr_setpshared.c b/src/thread/pthread_rwlockattr_setpshared.c index 1f47f093..e7061973 100644 --- a/src/thread/pthread_rwlockattr_setpshared.c +++ b/src/thread/pthread_rwlockattr_setpshared.c @@ -3,6 +3,6 @@ int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *a, int pshared) { if (pshared > 1U) return EINVAL; - *(int *)a = pshared; + a->__attr[0] = pshared; return 0; } |