summaryrefslogtreecommitdiff
path: root/gcc/gthr-posix.h
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-02 19:28:05 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-02 19:28:05 +0000
commit9d63dbe6b454a33381a73e1ca93aff85b0594f05 (patch)
treef8a1cb507af3e7ceb424d8056fc0f50558e9cd28 /gcc/gthr-posix.h
parentf98abc094eceacf320655d4f16c9f71243455544 (diff)
downloadgcc-9d63dbe6b454a33381a73e1ca93aff85b0594f05.tar.gz
2008-03-02 Basile Starynkevitch <basile@starynkevitch.net>
merged with trunk 132817 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@132818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-posix.h')
-rw-r--r--gcc/gthr-posix.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index ad6822e26ad..a6c9ba3b54f 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -94,6 +94,7 @@ __gthrw3(pthread_mutex_lock)
__gthrw3(pthread_mutex_trylock)
__gthrw3(pthread_mutex_unlock)
__gthrw3(pthread_mutex_init)
+__gthrw3(pthread_mutex_destroy)
__gthrw3(pthread_cond_broadcast)
__gthrw3(pthread_cond_wait)
#else
@@ -106,6 +107,7 @@ __gthrw(pthread_mutex_lock)
__gthrw(pthread_mutex_trylock)
__gthrw(pthread_mutex_unlock)
__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
__gthrw(pthread_cond_broadcast)
__gthrw(pthread_cond_wait)
#endif
@@ -124,14 +126,12 @@ __gthrw3(pthread_cond_destroy)
__gthrw3(pthread_cond_init)
__gthrw3(pthread_cond_signal)
__gthrw3(pthread_exit)
-__gthrw3(pthread_mutex_destroy)
__gthrw3(pthread_self)
#else
__gthrw(pthread_cond_destroy)
__gthrw(pthread_cond_init)
__gthrw(pthread_cond_signal)
__gthrw(pthread_exit)
-__gthrw(pthread_mutex_destroy)
__gthrw(pthread_self)
#endif /* __osf__ && _PTHREAD_USE_MANGLED_NAMES_ */
#ifdef _POSIX_PRIORITY_SCHEDULING
@@ -677,6 +677,15 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr)
}
static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *mutex)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_destroy) (mutex);
+ else
+ return 0;
+}
+
+static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex)
{
if (__gthread_active_p ())