OSDN Git Service

gcc:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Mar 2008 10:46:31 +0000 (10:46 +0000)
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Mar 2008 10:46:31 +0000 (10:46 +0000)
2008-03-01  Janne Blomqvist  <jb@gcc.gnu.org>

PR gcc/35063
* gthr.h: Add __gthread_mutex_destroy as a function that must be
implemented.
* gthr-vxworks.h (__gthread_mutex_destroy): Null implementation.
* gthr-single.h (__gthread_mutex_destroy): Likewise.
* gthr-rtems.h (__gthread_mutex_destroy): Likewise.
* gthr-mipssde.h (__gthread_mutex_destroy): Likewise.
* gthr-nks.h (__gthread_mutex_destroy): Likewise.
* gthr-solaris.h (__gthread_mutex_destroy): Call mutex_destroy.
* gthr-win32.h (__GTHREAD_MUTEX_DESTROY_FUNCTION): Remove.
(__gthread_mutex_destroy_function): Rename to
__gthread_mutex_destroy.
* gthr-dce.h (__gthread_mutex_destroy): Call
pthread_mutex_destroy.
* gthr-tpf.h (__gthread_mutex_destroy): Likewise.
* gthr-posix.h (__gthread_mutex_destroy): Likewise.
* gthr-posix95.h (__gthread_mutex_destroy): Likewise.

libgfortran:

2008-03-01  Janne Blomqvist  <jb@gcc.gnu.org>

PR libfortran/35063
* io/unit.c (destroy_unit_mutex): Call __gthread_mutex_destroy
instead of macro kludge.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132800 138bc75d-0d04-0410-961f-82ee72b054a4

15 files changed:
gcc/ChangeLog
gcc/gthr-dce.h
gcc/gthr-mipssde.h
gcc/gthr-nks.h
gcc/gthr-posix.h
gcc/gthr-posix95.h
gcc/gthr-rtems.h
gcc/gthr-single.h
gcc/gthr-solaris.h
gcc/gthr-tpf.h
gcc/gthr-vxworks.h
gcc/gthr-win32.h
gcc/gthr.h
libgfortran/ChangeLog
libgfortran/io/unit.c

index 96a538c..2455b17 100644 (file)
@@ -1,3 +1,23 @@
+2008-03-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR gcc/35063
+       * gthr.h: Add __gthread_mutex_destroy as a function that must be
+       implemented.
+       * gthr-vxworks.h (__gthread_mutex_destroy): Null implementation.
+       * gthr-single.h (__gthread_mutex_destroy): Likewise.
+       * gthr-rtems.h (__gthread_mutex_destroy): Likewise.
+       * gthr-mipssde.h (__gthread_mutex_destroy): Likewise.
+       * gthr-nks.h (__gthread_mutex_destroy): Likewise.
+       * gthr-solaris.h (__gthread_mutex_destroy): Call mutex_destroy.
+       * gthr-win32.h (__GTHREAD_MUTEX_DESTROY_FUNCTION): Remove.
+       (__gthread_mutex_destroy_function): Rename to
+       __gthread_mutex_destroy.
+       * gthr-dce.h (__gthread_mutex_destroy): Call
+       pthread_mutex_destroy.
+       * gthr-tpf.h (__gthread_mutex_destroy): Likewise.
+       * gthr-posix.h (__gthread_mutex_destroy): Likewise.
+       * gthr-posix95.h (__gthread_mutex_destroy): Likewise.
+
 2008-03-01  Alexandre Oliva  <aoliva@redhat.com>
 
        * df-scan.c (df_ref_chain_change_bb): Simplify.
index d876c65..e95a4e5 100644 (file)
@@ -71,6 +71,7 @@ __gthrw(pthread_getspecific)
 __gthrw(pthread_setspecific)
 __gthrw(pthread_create)
 __gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
 __gthrw(pthread_mutex_lock)
 __gthrw(pthread_mutex_trylock)
 __gthrw(pthread_mutex_unlock)
@@ -475,6 +476,15 @@ __gthread_mutex_init_function (__gthread_mutex_t *mutex)
 }
 
 static inline int
+__gthread_mutx_destroy (__gthread_mutex_t *mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_destroy) (mutex);
+  else
+    return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
   if (__gthread_active_p ())
index 28111e3..b8cf24e 100644 (file)
@@ -135,6 +135,12 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+{
+  return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
   if (__gthread_active_p ())
index 2c2b3e9..14027e0 100644 (file)
@@ -342,6 +342,12 @@ __gthread_mutex_init_function (__gthread_mutex_t *mutex)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+{
+  return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
   return NXLock (*mutex);
index ad6822e..b0c9ebb 100644 (file)
@@ -94,6 +94,7 @@ __gthrw3(pthread_mutex_lock)
 __gthrw3(pthread_mutex_trylock)
 __gthrw3(pthread_mutex_unlock)
 __gthrw3(pthread_mutex_init)
+__gthrw3(pthread_mutex_destroy)
 __gthrw3(pthread_cond_broadcast)
 __gthrw3(pthread_cond_wait)
 #else
@@ -106,6 +107,7 @@ __gthrw(pthread_mutex_lock)
 __gthrw(pthread_mutex_trylock)
 __gthrw(pthread_mutex_unlock)
 __gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
 __gthrw(pthread_cond_broadcast)
 __gthrw(pthread_cond_wait)
 #endif
@@ -677,6 +679,15 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_destroy) (mutex);
+  else
+    return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
   if (__gthread_active_p ())
index eb54c92..d993c13 100644 (file)
@@ -80,13 +80,14 @@ __gthrw(pthread_create)
 __gthrw(pthread_cancel)
 __gthrw(pthread_self)
 
+__gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
 __gthrw(pthread_mutex_lock)
 __gthrw(pthread_mutex_trylock)
 __gthrw(pthread_mutex_unlock)
 __gthrw(pthread_mutexattr_init)
 __gthrw(pthread_mutexattr_destroy)
 
-__gthrw(pthread_mutex_init)
 __gthrw(pthread_cond_broadcast)
 __gthrw(pthread_cond_wait)
 
@@ -640,6 +641,15 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_(pthread_mutex_destroy) (mutex);
+  else
+    return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
   if (__gthread_active_p ())
index f678aba..425d7de 100644 (file)
@@ -111,6 +111,12 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+{
+  return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
     return rtems_gxx_mutex_lock (mutex);
index c3a903d..7dd1f54 100644 (file)
@@ -216,6 +216,12 @@ __gthread_active_p (void)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+{
+  return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t * UNUSED(mutex))
 {
   return 0;
index 5665ecd..a726bfa 100644 (file)
@@ -462,6 +462,15 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr)
 }
 
 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 ())
index b63d527..fd80bd4 100644 (file)
@@ -92,6 +92,7 @@ __gthrw(pthread_mutexattr_init)
 __gthrw(pthread_mutexattr_settype)
 __gthrw(pthread_mutexattr_destroy)
 __gthrw(pthread_mutex_init)
+__gthrw(pthread_mutex_destroy)
 
 static inline int
 __gthread_active_p (void)
@@ -145,6 +146,15 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *mutex)
+{
+  if (__tpf_pthread_active ())
+    return __gthrw_(pthread_mutex_destroy) (mutex);
+  else
+    return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
   if (__tpf_pthread_active ())
index c11d3a2..ba81314 100644 (file)
@@ -61,6 +61,12 @@ __gthread_mutex_init_function (__gthread_mutex_t *mutex)
 }
 
 static inline int
+__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+{
+  return 0;
+}
+
+static inline int
 __gthread_mutex_lock (__gthread_mutex_t *mutex)
 {
   return semTake (*mutex, WAIT_FOREVER);
index 6a32c1a..b75c865 100644 (file)
@@ -359,9 +359,6 @@ typedef struct {
   __gthread_recursive_mutex_init_function
 #define __GTHREAD_RECURSIVE_MUTEX_INIT_DEFAULT {-1, 0, 0, 0}
 
-#define __GTHREAD_MUTEX_DESTROY_FUNCTION \
-  __gthread_mutex_destroy_function
-
 #if __MINGW32_MAJOR_VERSION >= 1 || \
   (__MINGW32_MAJOR_VERSION == 0 && __MINGW32_MINOR_VERSION > 2)
 #define MINGW32_SUPPORTS_MT_EH 1
@@ -619,7 +616,7 @@ __gthread_mutex_init_function (__gthread_mutex_t *mutex)
 }
 
 static inline void
-__gthread_mutex_destroy_function (__gthread_mutex_t *mutex)
+__gthread_mutex_destroy (__gthread_mutex_t *mutex)
 {
   CloseHandle ((HANDLE) mutex->sema);
 }
index a37b911..a145ef1 100644 (file)
@@ -73,6 +73,8 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
      void *__gthread_getspecific (__gthread_key_t key)
      int __gthread_setspecific (__gthread_key_t key, const void *ptr)
 
+     int __gthread_mutex_destroy (__gthread_mutex_t *mutex);
+
      int __gthread_mutex_lock (__gthread_mutex_t *mutex);
      int __gthread_mutex_trylock (__gthread_mutex_t *mutex);
      int __gthread_mutex_unlock (__gthread_mutex_t *mutex);
index 210a372..8ed3624 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/35063
+       * io/unit.c (destroy_unit_mutex): Call __gthread_mutex_destroy
+       instead of macro kludge.
+       
 2008-02-25  Janne Blomqvist  <jb@gcc.gnu.org>
 
        PR fortran/29549
index 2ec776f..a54061d 100644 (file)
@@ -209,13 +209,7 @@ insert_unit (int n)
 static void
 destroy_unit_mutex (gfc_unit * u)
 {
-#ifdef __GTHREAD_MUTEX_DESTROY_FUNCTION
-  __GTHREAD_MUTEX_DESTROY_FUNCTION (&u->lock);
-#else
-#ifdef __CYGWIN__
-  pthread_mutex_destroy (&u->lock);
-#endif
-#endif
+  __gthread_mutex_destroy (&u->lock);
   free_mem (u);
 }