diff options
Diffstat (limited to 'sysdeps/generic/bits')
-rw-r--r-- | sysdeps/generic/bits/condition.h | 5 | ||||
-rw-r--r-- | sysdeps/generic/bits/mutex.h | 10 | ||||
-rw-r--r-- | sysdeps/generic/bits/rwlock.h | 8 |
3 files changed, 11 insertions, 12 deletions
diff --git a/sysdeps/generic/bits/condition.h b/sysdeps/generic/bits/condition.h index cb7e935..f3b09be 100644 --- a/sysdeps/generic/bits/condition.h +++ b/sysdeps/generic/bits/condition.h @@ -1,5 +1,5 @@ /* Condition type. Generic version. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -34,7 +34,6 @@ struct __pthread_cond /* Initializer for a condition variable. */ #define __PTHREAD_COND_INITIALIZER \ - ((struct __pthread_cond) \ - { __SPIN_LOCK_INITIALIZER, NULL, NULL, NULL, NULL }) + { __SPIN_LOCK_INITIALIZER, NULL, NULL, NULL, NULL } #endif /* bits/condition.h */ diff --git a/sysdeps/generic/bits/mutex.h b/sysdeps/generic/bits/mutex.h index 9958b8d..2e32d78 100644 --- a/sysdeps/generic/bits/mutex.h +++ b/sysdeps/generic/bits/mutex.h @@ -1,5 +1,5 @@ /* Mutex type. Generic version. - Copyright (C) 2000,02 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -52,9 +52,7 @@ struct __pthread_mutex /* Initializer for a mutex. N.B. this also happens to be compatible with the cthread mutex initializer. */ # define __PTHREAD_MUTEX_INITIALIZER \ - ((struct __pthread_mutex) \ - { __SPIN_LOCK_INITIALIZER, __SPIN_LOCK_INITIALIZER, NULL, NULL, NULL, \ - NULL, 0, 0 }) + { __SPIN_LOCK_INITIALIZER, __SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0, 0 } # endif #endif /* Not __pthread_mutex_defined. */ @@ -74,13 +72,15 @@ _EXTERN_INLINE int pthread_mutex_init (struct __pthread_mutex *__mutex, const pthread_mutexattr_t *attr) { + struct __pthread_mutex initialized_mutex = __PTHREAD_MUTEX_INITIALIZER; + extern int _pthread_mutex_init (struct __pthread_mutex *, const pthread_mutexattr_t *); if (attr) return _pthread_mutex_init (__mutex, attr); - *__mutex = __PTHREAD_MUTEX_INITIALIZER; + *__mutex = initialized_mutex; return 0; } diff --git a/sysdeps/generic/bits/rwlock.h b/sysdeps/generic/bits/rwlock.h index d089b0c..5793f65 100644 --- a/sysdeps/generic/bits/rwlock.h +++ b/sysdeps/generic/bits/rwlock.h @@ -1,5 +1,5 @@ /* rwlock type. Generic version. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,21 +40,21 @@ struct __pthread_rwlock /* Initializer for a rwlock. */ #define __PTHREAD_RWLOCK_INITIALIZER \ - ((struct __pthread_rwlock) \ - { __SPIN_LOCK_INITIALIZER, __SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0 }) + { __SPIN_LOCK_INITIALIZER, __SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0 } _EXTERN_INLINE int pthread_rwlock_init (struct __pthread_rwlock *__rwlock, const struct __pthread_rwlockattr *__attr) { + struct __pthread_rwlock initialized_rwlock = __PTHREAD_RWLOCK_INITIALIZER; extern int _pthread_rwlock_init (struct __pthread_rwlock *, const struct __pthread_rwlockattr *); if (__attr) return _pthread_rwlock_init (__rwlock, __attr); - *__rwlock = __PTHREAD_RWLOCK_INITIALIZER; + *__rwlock = initialized_rwlock; return 0; } |