This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: gthr-dce.h update for v3 thread compatibility
- To: dave at hiauly1 dot hia dot nrc dot ca (John David Anglin)
- Subject: Re: PATCH: gthr-dce.h update for v3 thread compatibility
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Sun, 10 Jun 2001 00:21:21 -0400 (EDT)
- Cc: rittle at labs dot mot dot com, gcc-patches at gcc dot gnu dot org
This is the gthr-dce.h update for the main.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
Index: gthr-dce.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gthr-dce.h,v
retrieving revision 1.11
diff -c -3 -p -r1.11 gthr-dce.h
*** gthr-dce.h 2001/05/30 22:38:43 1.11
--- gthr-dce.h 2001/06/09 20:00:31
*************** typedef pthread_once_t __gthread_once_t;
*** 48,55 ****
typedef pthread_mutex_t __gthread_mutex_t;
#define __GTHREAD_ONCE_INIT pthread_once_init
- /* Howto define __GTHREAD_MUTEX_INIT? */
#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
#pragma weak pthread_once
--- 48,56 ----
typedef pthread_mutex_t __gthread_mutex_t;
#define __GTHREAD_ONCE_INIT pthread_once_init
+ #define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
+
#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
#pragma weak pthread_once
*************** typedef pthread_mutex_t __gthread_mutex_
*** 59,65 ****
#pragma weak pthread_getspecific
#pragma weak pthread_setspecific
#pragma weak pthread_create
!
#pragma weak pthread_mutex_lock
#pragma weak pthread_mutex_trylock
#pragma weak pthread_mutex_unlock
--- 60,66 ----
#pragma weak pthread_getspecific
#pragma weak pthread_setspecific
#pragma weak pthread_create
! #pragma weak pthread_mutex_init
#pragma weak pthread_mutex_lock
#pragma weak pthread_mutex_trylock
#pragma weak pthread_mutex_unlock
*************** typedef pthread_mutex_t __gthread_mutex_
*** 73,79 ****
#pragma weak pthread_cond_wait
#pragma weak pthread_exit
#pragma weak pthread_getunique_np
- #pragma weak pthread_mutex_init
#pragma weak pthread_mutex_destroy
#pragma weak pthread_self
#pragma weak pthread_yield
--- 74,79 ----
*************** __gthread_key_dtor (UNUSED (__gthread_ke
*** 424,443 ****
return 0;
}
- #if defined (__PTHREAD_LIBRARY_VERSION_1) && __PTHREAD_LIBRARY_VERSION_1 >= 1
- static inline int
- __gthread_key_delete (__gthread_key_t key)
- {
- return pthread_key_delete (key);
- }
- #else
static inline int
__gthread_key_delete (UNUSED (__gthread_key_t key))
{
/* Operation is not supported. */
return -1;
}
- #endif
static inline void *
__gthread_getspecific (__gthread_key_t key)
--- 424,435 ----
*************** static inline int
*** 453,458 ****
--- 445,457 ----
__gthread_setspecific (__gthread_key_t key, const void *ptr)
{
return pthread_setspecific (key, (void *) ptr);
+ }
+
+ static inline void
+ __gthread_mutex_init_function (__gthread_mutex_t *mutex)
+ {
+ if (__gthread_active_p ())
+ pthread_mutex_init (mutex, pthread_mutexattr_default);
}
static inline int