This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch/mingw32]: Add __gthread_mutex_destroy for __GTHREAD_HIDE_WIN32API case


This patch adds __gthr_win32_mutex_destroy to libgcc for mingw32 target
to provide an implementation of__gthread_mutex_destroy for uses where we
want to hide the symbols in the Win32 API.

As committed.


2008-03-04  Danny Smith  <dannysmith@users.sourceforge.net>

	* gthr-win32.h [__GTHREAD_HIDE_WIN32API]
	(__gthr_win32_mutex_destroy): Declare.
	[__GTHREAD_HIDE_WIN32API] (__gthread_mutex_destroy): Use
	__gthr_win32_mutex_destroy.
	* config/i386/gthr-win32.c  (__gthr_win32_mutex_destroy): Define.
	
	


Index: gthr-win32.h
===================================================================
--- gthr-win32.h	(revision 132829)
+++ gthr-win32.h	(working copy)
@@ -423,6 +423,7 @@
 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))
@@ -463,6 +464,12 @@
   __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)
 {
Index: config/i386/gthr-win32.c
===================================================================
--- config/i386/gthr-win32.c	(revision 132829)
+++ config/i386/gthr-win32.c	(working copy)
@@ -151,6 +151,12 @@
   mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL);
 }

+void
+__gthr_win32_mutex_destroy (__gthread_mutex_t *mutex)
+{
+  CloseHandle ((HANDLE) mutex->sema);
+}
+
 int
 __gthr_win32_mutex_lock (__gthread_mutex_t *mutex)
 {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]