push cc8bc80451cc24f4d7cf75168b569f0ebfe19547
[wine/hacks.git] / include / wine / pthread.h
blob561c22c522125566c231fd72df78f712f58033d8
1 /*
2 * Definitions for Wine pthread emulation
4 * Copyright 2003 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINE_PTHREAD_H
22 #define __WINE_WINE_PTHREAD_H
24 struct wine_pthread_callbacks;
26 #include <signal.h>
28 #ifndef HAVE_SIGSET_T
29 struct sigset_t;
30 typedef struct sigset_t sigset_t;
31 #endif
33 /* thread information used to creating and exiting threads */
34 struct wine_pthread_thread_info
36 void *stack_base; /* base address of the stack */
37 size_t stack_size; /* size of the stack */
38 void *teb_base; /* base address of the TEB */
39 size_t teb_size; /* size of the TEB (possibly including signal stack) */
40 unsigned short teb_sel; /* selector to use for TEB */
41 int pid; /* Unix process id */
42 int tid; /* Unix thread id */
43 void (*entry)( struct wine_pthread_thread_info *info ); /* thread entry point */
44 long exit_status; /* thread exit status when calling wine_pthread_exit_thread */
47 struct wine_pthread_functions
49 void (*init_process)( const struct wine_pthread_callbacks *callbacks, size_t size );
50 void (*init_thread)( struct wine_pthread_thread_info *info );
51 int (*create_thread)( struct wine_pthread_thread_info *info );
52 void (*init_current_teb)( struct wine_pthread_thread_info *info );
53 void * (*get_current_teb)(void);
54 #ifdef __GNUC__
55 void (* __attribute__((noreturn)) exit_thread)( struct wine_pthread_thread_info *info );
56 void (* __attribute__((noreturn)) abort_thread)( long status );
57 #else
58 void (*exit_thread)( struct wine_pthread_thread_info *info );
59 void (*abort_thread)( long status );
60 #endif
61 int (*sigprocmask)( int how, const sigset_t *newset, sigset_t *oldset );
64 extern void wine_pthread_get_functions( struct wine_pthread_functions *functions, size_t size );
65 extern void wine_pthread_set_functions( const struct wine_pthread_functions *functions, size_t size );
67 #endif /* __WINE_WINE_PTHREAD_H */