1  /* Implementation of threads compatibility routines for libgcc2.  */
       2  
       3  /* Copyright (C) 1999-2023 Free Software Foundation, Inc.
       4  
       5  This file is part of GCC.
       6  
       7  GCC is free software; you can redistribute it and/or modify it under
       8  the terms of the GNU General Public License as published by the Free
       9  Software Foundation; either version 3, or (at your option) any later
      10  version.
      11  
      12  GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      13  WARRANTY; without even the implied warranty of MERCHANTABILITY or
      14  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      15  for more details.
      16  
      17  Under Section 7 of GPL version 3, you are granted additional
      18  permissions described in the GCC Runtime Library Exception, version
      19  3.1, as published by the Free Software Foundation.
      20  
      21  You should have received a copy of the GNU General Public License and
      22  a copy of the GCC Runtime Library Exception along with this program;
      23  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
      24  <http://www.gnu.org/licenses/>.  */
      25  
      26  /* Get the out-of-line version of the inline routines.  */
      27  
      28  #define __GTHREAD_WIN32_ACTIVE_P() 1
      29  #define __GTHREAD_WIN32_INLINE
      30  
      31  #define __gthread_detach __gthr_win32_detach
      32  #define __gthread_equal __gthr_win32_equal
      33  #define __gthread_yield __gthr_win32_yield
      34  #define __gthread_once __gthr_win32_once
      35  #define __gthread_key_create __gthr_win32_key_create
      36  #define __gthread_key_delete __gthr_win32_key_delete
      37  #define __gthread_getspecific __gthr_win32_getspecific
      38  #define __gthread_setspecific __gthr_win32_setspecific
      39  #define __gthread_mutex_init_function __gthr_win32_mutex_init_function
      40  #define __gthread_mutex_destroy __gthr_win32_mutex_destroy
      41  #define __gthread_mutex_lock __gthr_win32_mutex_lock
      42  #define __gthread_mutex_trylock __gthr_win32_mutex_trylock
      43  #define __gthread_mutex_unlock __gthr_win32_mutex_unlock
      44  #define __gthread_recursive_mutex_trylock __gthr_win32_recursive_mutex_trylock
      45  
      46  #include "gthr-win32.h"
      47  
      48  /* Check the sizes of the local version of the Win32 types.  */
      49  
      50  #define CHECK_SIZE_OF(TYPE) \
      51    typedef int assertion[sizeof(__gthr_win32_##TYPE) == sizeof(TYPE) ? 1 : -1];
      52  
      53  CHECK_SIZE_OF (DWORD)
      54  CHECK_SIZE_OF (HANDLE)
      55  CHECK_SIZE_OF (CRITICAL_SECTION)