diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-19 06:47:18 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-19 06:47:18 +0000 |
commit | bcb88c83f7f3b6af46033f868a41fdb95ab58471 (patch) | |
tree | 4d94d9ea56f3e59272cf6d1b6db315608728e019 /gcc/gthr-posix95.h | |
parent | 375fd1e226f147e8fb207fb51b7fa04ea1f61b9e (diff) | |
download | gcc-bcb88c83f7f3b6af46033f868a41fdb95ab58471.tar.gz |
2009-02-19 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r144284
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@144287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-posix95.h')
-rw-r--r-- | gcc/gthr-posix95.h | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/gcc/gthr-posix95.h b/gcc/gthr-posix95.h index 190b097d284..9310a7e2dd0 100644 --- a/gcc/gthr-posix95.h +++ b/gcc/gthr-posix95.h @@ -1,6 +1,6 @@ /* Threads compatibility routines for libgcc2 and libobjc. */ /* Compile this one with gcc. */ -/* Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -610,150 +610,150 @@ __gthread_objc_condition_signal (objc_condition_t condition) #else /* _LIBOBJC */ static inline int -__gthread_once (__gthread_once_t *once, void (*func) (void)) +__gthread_once (__gthread_once_t *__once, void (*__func) (void)) { if (__gthread_active_p ()) - return __gthrw_(pthread_once) (once, func); + return __gthrw_(pthread_once) (__once, __func); else return -1; } static inline int -__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) +__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *)) { - return __gthrw_(pthread_key_create) (key, dtor); + return __gthrw_(pthread_key_create) (__key, __dtor); } static inline int -__gthread_key_delete (__gthread_key_t key) +__gthread_key_delete (__gthread_key_t __key) { - return __gthrw_(pthread_key_delete) (key); + return __gthrw_(pthread_key_delete) (__key); } static inline void * -__gthread_getspecific (__gthread_key_t key) +__gthread_getspecific (__gthread_key_t __key) { - return __gthrw_(pthread_getspecific) (key); + return __gthrw_(pthread_getspecific) (__key); } static inline int -__gthread_setspecific (__gthread_key_t key, const void *ptr) +__gthread_setspecific (__gthread_key_t __key, const void *__ptr) { - return __gthrw_(pthread_setspecific) (key, ptr); + return __gthrw_(pthread_setspecific) (__key, __ptr); } static inline int -__gthread_mutex_destroy (__gthread_mutex_t *mutex) +__gthread_mutex_destroy (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) - return __gthrw_(pthread_mutex_destroy) (mutex); + return __gthrw_(pthread_mutex_destroy) (__mutex); else return 0; } static inline int -__gthread_mutex_lock (__gthread_mutex_t *mutex) +__gthread_mutex_lock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) - return __gthrw_(pthread_mutex_lock) (mutex); + return __gthrw_(pthread_mutex_lock) (__mutex); else return 0; } static inline int -__gthread_mutex_trylock (__gthread_mutex_t *mutex) +__gthread_mutex_trylock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) - return __gthrw_(pthread_mutex_trylock) (mutex); + return __gthrw_(pthread_mutex_trylock) (__mutex); else return 0; } static inline int -__gthread_mutex_unlock (__gthread_mutex_t *mutex) +__gthread_mutex_unlock (__gthread_mutex_t *__mutex) { if (__gthread_active_p ()) - return __gthrw_(pthread_mutex_unlock) (mutex); + return __gthrw_(pthread_mutex_unlock) (__mutex); else return 0; } static inline int -__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *mutex) +__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex) { - mutex->depth = 0; - mutex->owner = (pthread_t) 0; - return __gthrw_(pthread_mutex_init) (&mutex->actual, NULL); + __mutex->depth = 0; + __mutex->owner = (pthread_t) 0; + return __gthrw_(pthread_mutex_init) (&__mutex->actual, NULL); } static inline int -__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex) +__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex) { if (__gthread_active_p ()) { - pthread_t me = __gthrw_(pthread_self) (); + pthread_t __me = __gthrw_(pthread_self) (); - if (mutex->owner != me) + if (__mutex->owner != __me) { - __gthrw_(pthread_mutex_lock) (&mutex->actual); - mutex->owner = me; + __gthrw_(pthread_mutex_lock) (&__mutex->actual); + __mutex->owner = __me; } - mutex->depth++; + __mutex->depth++; } return 0; } static inline int -__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex) +__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex) { if (__gthread_active_p ()) { - pthread_t me = __gthrw_(pthread_self) (); + pthread_t __me = __gthrw_(pthread_self) (); - if (mutex->owner != me) + if (__mutex->owner != __me) { - if (__gthrw_(pthread_mutex_trylock) (&mutex->actual)) + if (__gthrw_(pthread_mutex_trylock) (&__mutex->actual)) return 1; - mutex->owner = me; + __mutex->owner = __me; } - mutex->depth++; + __mutex->depth++; } return 0; } static inline int -__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex) +__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex) { if (__gthread_active_p ()) { - if (--mutex->depth == 0) + if (--__mutex->depth == 0) { - mutex->owner = (pthread_t) 0; - __gthrw_(pthread_mutex_unlock) (&mutex->actual); + __mutex->owner = (pthread_t) 0; + __gthrw_(pthread_mutex_unlock) (&__mutex->actual); } } return 0; } static inline int -__gthread_cond_broadcast (__gthread_cond_t *cond) +__gthread_cond_broadcast (__gthread_cond_t *__cond) { - return __gthrw_(pthread_cond_broadcast) (cond); + return __gthrw_(pthread_cond_broadcast) (__cond); } static inline int -__gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex) +__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex) { - return __gthrw_(pthread_cond_wait) (cond, mutex); + return __gthrw_(pthread_cond_wait) (__cond, __mutex); } static inline int -__gthread_cond_wait_recursive (__gthread_cond_t *cond, - __gthread_recursive_mutex_t *mutex) +__gthread_cond_wait_recursive (__gthread_cond_t *__cond, + __gthread_recursive_mutex_t *__mutex) { - return __gthrw_(pthread_cond_wait) (cond, &mutex->actual); + return __gthrw_(pthread_cond_wait) (__cond, &__mutex->actual); } #endif /* _LIBOBJC */ |