coarray_43.f90: Add "-latomic" option if libatomic_available.
[gcc.git] / libgcc / gthr.h
index 607c26eb563f5353886f393586e87896b89115eb..ed22dc94476645a9cb8c06664d77362ce396edb5 100644 (file)
@@ -1,7 +1,6 @@
 /* Threads compatibility routines for libgcc2.  */
 /* Compile this one with gcc.  */
-/* Copyright (C) 1997, 1998, 2004, 2008, 2009, 2011
-   Free Software Foundation, Inc.
+/* Copyright (C) 1997-2017 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -52,11 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
                to initialize __gthread_mutex_t to get a fast
                non-recursive mutex.
      __GTHREAD_MUTEX_INIT_FUNCTION
-               some systems can't initialize a mutex without a
-               function call.  On such systems, define this to a
-               function which looks like this:
+               to initialize __gthread_mutex_t to get a fast
+               non-recursive mutex.
+               Define this to a function which looks like this:
                  void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *)
-               Don't define __GTHREAD_MUTEX_INIT in this case
+               Some systems can't initialize a mutex without a
+               function call.  Don't define __GTHREAD_MUTEX_INIT in this case.
      __GTHREAD_RECURSIVE_MUTEX_INIT
      __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
                as above, but for a recursive mutex.
@@ -72,6 +72,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
      int __gthread_setspecific (__gthread_key_t key, const void *ptr)
 
      int __gthread_mutex_destroy (__gthread_mutex_t *mutex);
+     int __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *mutex);
 
      int __gthread_mutex_lock (__gthread_mutex_t *mutex);
      int __gthread_mutex_trylock (__gthread_mutex_t *mutex);
@@ -128,13 +129,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
      int __gthread_cond_timedwait (__gthread_cond_t *cond,
                                    __gthread_mutex_t *mutex,
                                    const __gthread_time_t *abs_timeout);
-     int __gthread_cond_timedwait_recursive (__gthread_cond_t *cond,
-                                             __gthread_recursive_mutex_t *mutex,
-                                             const __gthread_time_t *abs_time)
 
 */
 
 #if SUPPORTS_WEAK
+/* The pe-coff weak support isn't fully compatible to ELF's weak.
+   For static libraries it might would work, but as we need to deal
+   with shared versions too, we disable it for mingw-targets.  */
+#ifdef __MINGW32__
+#undef GTHREAD_USE_WEAK
+#define GTHREAD_USE_WEAK 0
+#endif
+
 #ifndef GTHREAD_USE_WEAK
 #define GTHREAD_USE_WEAK 1
 #endif