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.
This commit is contained in:
Rich Felker
2013-07-22 13:57:02 -04:00
parent c4dd0c98ba
commit 0109d950e6
12 changed files with 25 additions and 25 deletions

View File

@ -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;
}