diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2007-08-02 22:51:14 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2007-08-02 22:51:14 +0000 |
commit | b180c6076f787d1b7241153dc1a42f37262dd827 (patch) | |
tree | 7de9f59f4267e3b11c0835f9698d191dd9314558 | |
parent | 0b48c1e5d1764b5970faa0abeb101f377c3f441c (diff) |
2007-08-02 Samuel Thibault <samuel.thibault@ens-lyon.org>
* sysdeps/generic/bits/mutex.h (pthread_mutex_init)
(pthread_mutex_destroy, __pthread_mutex_lock, __pthread_mutex_trylock)
(pthread_mutex_lock, pthread_mutex_trylock): Remove inline
definitions.
* sysdeps/generic/bits/rwlock.h (pthread_rwlock_init)
(pthread_rwlock_destroy): Likewise.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | sysdeps/generic/bits/mutex.h | 72 | ||||
-rw-r--r-- | sysdeps/generic/bits/rwlock.h | 29 |
3 files changed, 9 insertions, 101 deletions
@@ -1,3 +1,12 @@ +2007-08-02 Samuel Thibault <samuel.thibault@ens-lyon.org> + + * sysdeps/generic/bits/mutex.h (pthread_mutex_init) + (pthread_mutex_destroy, __pthread_mutex_lock, __pthread_mutex_trylock) + (pthread_mutex_lock, pthread_mutex_trylock): Remove inline + definitions. + * sysdeps/generic/bits/rwlock.h (pthread_rwlock_init) + (pthread_rwlock_destroy): Likewise. + 2007-06-24 Samuel Thibault <samuel.thibault@ens-lyon.org> * include/semaphore.h (sem_timedwait): Declare only if __USE_XOPEN2K diff --git a/sysdeps/generic/bits/mutex.h b/sysdeps/generic/bits/mutex.h index feb6d07..1aaf80e 100644 --- a/sysdeps/generic/bits/mutex.h +++ b/sysdeps/generic/bits/mutex.h @@ -62,78 +62,6 @@ struct __pthread_mutex #include <errno.h> #include <stddef.h> -#ifdef __USE_EXTERN_INLINES - -# ifndef _EXTERN_INLINE -# define _EXTERN_INLINE extern __inline -# endif - -_EXTERN_INLINE int -pthread_mutex_init (struct __pthread_mutex *__restrict __mutex, - const pthread_mutexattr_t *__restrict 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 = initialized_mutex; - return 0; -} - -_EXTERN_INLINE int -pthread_mutex_destroy (struct __pthread_mutex *__mutex) -{ - extern int _pthread_mutex_destroy (struct __pthread_mutex *); - - if (__mutex->attr || __mutex->data) - return _pthread_mutex_destroy (__mutex); - - return 0; -} - -_EXTERN_INLINE int -__pthread_mutex_lock (struct __pthread_mutex *__mutex) -{ - extern int _pthread_mutex_lock (struct __pthread_mutex *); - - if (__mutex->attr == NULL - && __mutex->data == NULL - && __pthread_spin_trylock (&__mutex->__held) == 0) - return 0; - - return _pthread_mutex_lock (__mutex); -} - -extern __inline int -__pthread_mutex_trylock (struct __pthread_mutex *__mutex) -{ - extern int _pthread_mutex_trylock (struct __pthread_mutex *); - - if (__mutex->attr == NULL - && __mutex->data == NULL) - return __pthread_spin_trylock (&__mutex->__held); - - return _pthread_mutex_trylock (__mutex); -} - -extern __inline int -pthread_mutex_lock (struct __pthread_mutex *__mutex) -{ - return __pthread_mutex_lock (__mutex); -} - -extern __inline int -pthread_mutex_trylock (struct __pthread_mutex *__mutex) -{ - return __pthread_mutex_trylock (__mutex); -} - -#endif /* Use extern inlines. */ - #endif #endif /* bits/mutex.h */ diff --git a/sysdeps/generic/bits/rwlock.h b/sysdeps/generic/bits/rwlock.h index 5afc4a3..696f9c2 100644 --- a/sysdeps/generic/bits/rwlock.h +++ b/sysdeps/generic/bits/rwlock.h @@ -43,33 +43,4 @@ struct __pthread_rwlock { __SPIN_LOCK_INITIALIZER, __SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0 } -#if defined __USE_UNIX98 || defined __USE_XOPEN2K -_EXTERN_INLINE int -pthread_rwlock_init (struct __pthread_rwlock *__restrict __rwlock, - const struct __pthread_rwlockattr *__restrict __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 = initialized_rwlock; - return 0; -} - -_EXTERN_INLINE int -pthread_rwlock_destroy (struct __pthread_rwlock *__rwlock) -{ - extern int _pthread_rwlock_destroy (struct __pthread_rwlock *); - - if (__rwlock->__attr - || __rwlock->__data) - return _pthread_rwlock_destroy (__rwlock); - - return 0; -} -#endif - #endif /* bits/rwlock.h */ |