X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fgthr.h;h=70345a57c6a086a1d26bf116ab9ffe4b1702b514;hb=5c88dcc789b8025c882c8cb1488b0151c01d13a6;hp=b05115436452a284526dbbe2e5a3e7f70170434e;hpb=805e22b2051e9c6a75377ea6599654d7415da483;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/gthr.h b/gcc/gthr.h index b0511543645..70345a57c6a 100644 --- a/gcc/gthr.h +++ b/gcc/gthr.h @@ -1,6 +1,6 @@ /* Threads compatibility routines for libgcc2. */ /* Compile this one with gcc. */ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -29,6 +29,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef GCC_GTHR_H #define GCC_GTHR_H +#pragma GCC visibility push(default) + /* If this file is compiled with threads support, it must #define __GTHREADS 1 to indicate that threads support is present. Also it has define @@ -40,6 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA __gthread_key_t __gthread_once_t __gthread_mutex_t + __gthread_recursive_mutex_t The threads interface must define the following macros: @@ -54,6 +57,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA function which looks like this: void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *) 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. The threads interface must define the following static functions: @@ -69,18 +75,28 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA int __gthread_mutex_trylock (__gthread_mutex_t *mutex); int __gthread_mutex_unlock (__gthread_mutex_t *mutex); + int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex); + int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex); + int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex); + All functions returning int should return zero on success or the error number. If the operation is not supported, -1 is returned. Currently supported threads packages are - POSIX threads with -D_PTHREADS + TPF threads with -D__tpf__ + POSIX/Unix98 threads with -D_PTHREADS + POSIX/Unix95 threads with -D_PTHREADS95 DCE threads with -D_DCE_THREADS Solaris/UI threads with -D_SOLARIS_THREADS */ /* Check first for thread specific defines. */ -#if _PTHREADS +#if defined (__tpf__) +#include "gthr-tpf.h" +#elif _PTHREADS #include "gthr-posix.h" +#elif _PTHREADS95 +#include "gthr-posix95.h" #elif _DCE_THREADS #include "gthr-dce.h" #elif _SOLARIS_THREADS @@ -100,4 +116,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "gthr-single.h" #endif +#pragma GCC visibility pop + #endif /* ! GCC_GTHR_H */