/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000, 2004, 2005
+/* Copyright (C) 1997, 1999, 2000, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GCC.
#include <thread.h>
#include <errno.h>
+#ifdef __cplusplus
+#define UNUSED(x)
+#else
+#define UNUSED(x) x __attribute__((unused))
+#endif
+
typedef thread_key_t __gthread_key_t;
typedef struct {
mutex_t mutex;
__gthrw(thr_getspecific)
__gthrw(thr_setspecific)
__gthrw(thr_create)
+__gthrw(thr_self)
+__gthrw(mutex_init)
+__gthrw(mutex_destroy)
__gthrw(mutex_lock)
__gthrw(mutex_trylock)
__gthrw(mutex_unlock)
#ifdef _LIBOBJC
__gthrw(thr_exit)
-__gthrw(thr_keycreate)
__gthrw(thr_getprio)
-__gthrw(thr_self)
__gthrw(thr_setprio)
__gthrw(thr_yield)
__gthrw(cond_broadcast)
__gthrw(cond_signal)
-__gthrw(mutex_init)
-__gthrw(mutex_destroy)
#endif
#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
}
static inline int
-__gthread_key_delete (__gthread_key_t key)
+__gthread_key_delete (__gthread_key_t UNUSED (key))
{
/* Not possible. */
return -1;
}
static inline int
+__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+{
+ if (__gthread_active_p ())
+ return __gthrw_(mutex_destroy) (mutex);
+ else
+ return 0;
+}
+
+static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex)
{
if (__gthread_active_p ())
#endif /* _LIBOBJC */
+#undef UNUSED
+
#endif /* ! GCC_GTHR_SOLARIS_H */