extern int
__gthr_win32_recursive_mutex_trylock (__gthread_recursive_mutex_t *);
extern int __gthr_win32_recursive_mutex_unlock (__gthread_recursive_mutex_t *);
+extern void __gthr_win32_mutex_destroy (__gthread_mutex_t *);
static inline int
__gthread_once (__gthread_once_t *once, void (*func) (void))
__gthr_win32_mutex_init_function (mutex);
}
+static inline void
+__gthread_mutex_destroy (__gthread_mutex_t *mutex)
+{
+ __gthr_win32_mutex_destroy (mutex);
+}
+
static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex)
{
leaks, especially in threaded applications making extensive use of
C++ EH. Mingw uses a thread-support DLL to work-around this problem. */
static inline int
-__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
+__gthread_key_create (__gthread_key_t *key,
+ void (*dtor) (void *) __attribute__((unused)))
{
int status = 0;
DWORD tls_index = TlsAlloc ();
mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL);
}
+static inline void
+__gthread_mutex_destroy (__gthread_mutex_t *mutex)
+{
+ CloseHandle ((HANDLE) mutex->sema);
+}
+
static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex)
{