2 Copyright (C) 2001, 2004, 2005 Axis Communications AB.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 1. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
12 2. Neither the name of Axis Communications nor the names of its
13 contributors may be used to endorse or promote products derived
14 from this software without specific prior written permission.
16 THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
17 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
20 COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 POSSIBILITY OF SUCH DAMAGE. */
29 /* Simple fallback-include to enable thread-enabled exception support
30 for libgcc, but with posix-interface to a default-dummy, so a posix
31 library can optionally be linked in, which isn't possible if
32 gthr-single.h is used. No other use is supported; *DO NOT* think
33 this gives you a valid pthread interface to use in your applications. */
41 # define __THROW throw ()
49 typedef int pthread_once_t
;
50 typedef unsigned int pthread_key_t
;
52 /* This must be layout-compatible with the linuxthreads type. */
58 struct { long int e
; int f
; } g
;
61 /* This give bits equal to the linuxthreads initializer. */
62 #define PTHREAD_MUTEX_INITIALIZER \
65 #define PTHREAD_ONCE_INIT 0
67 /* This isn't the right prototype, but it let's us get away with not
68 defining a lot of datatypes. */
69 extern int pthread_create (void) __THROW
;
71 extern int pthread_once (pthread_once_t
*, void (*) (void)) __THROW
;
73 extern int pthread_key_create (pthread_key_t
*, void (*) (void *)) __THROW
;
75 extern int pthread_setspecific (pthread_key_t
, const void *) __THROW
;
77 extern void *pthread_getspecific (pthread_key_t
) __THROW
;
79 extern int pthread_mutex_lock (pthread_mutex_t
*) __THROW
;
81 extern int pthread_key_delete (pthread_key_t
) __THROW
;
83 extern int pthread_mutex_trylock (pthread_mutex_t
*) __THROW
;
85 extern int pthread_mutex_unlock (pthread_mutex_t
*) __THROW
;
93 #endif /* not _PTHREAD_FAKE */