1 | /*
|
---|
2 | * Definitions for Wine pthread emulation
|
---|
3 | *
|
---|
4 | * Copyright 2003 Alexandre Julliard
|
---|
5 | *
|
---|
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.
|
---|
10 | *
|
---|
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.
|
---|
15 | *
|
---|
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
|
---|
19 | */
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef __WINE_WINE_PTHREAD_H
|
---|
31 | #define __WINE_WINE_PTHREAD_H
|
---|
32 |
|
---|
33 | struct wine_pthread_callbacks;
|
---|
34 |
|
---|
35 | #include <signal.h>
|
---|
36 |
|
---|
37 | #ifndef HAVE_SIGSET_T
|
---|
38 | struct sigset_t;
|
---|
39 | typedef struct sigset_t sigset_t;
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | /* thread information used to creating and exiting threads */
|
---|
43 | struct wine_pthread_thread_info
|
---|
44 | {
|
---|
45 | void *stack_base; /* base address of the stack */
|
---|
46 | size_t stack_size; /* size of the stack */
|
---|
47 | void *teb_base; /* base address of the TEB */
|
---|
48 | size_t teb_size; /* size of the TEB (possibly including signal stack) */
|
---|
49 | unsigned short teb_sel; /* selector to use for TEB */
|
---|
50 | int pid; /* Unix process id */
|
---|
51 | int tid; /* Unix thread id */
|
---|
52 | void (*entry)( struct wine_pthread_thread_info *info ); /* thread entry point */
|
---|
53 | long exit_status; /* thread exit status when calling wine_pthread_exit_thread */
|
---|
54 | };
|
---|
55 |
|
---|
56 | struct wine_pthread_functions
|
---|
57 | {
|
---|
58 | void (*init_process)( const struct wine_pthread_callbacks *callbacks, size_t size );
|
---|
59 | void (*init_thread)( struct wine_pthread_thread_info *info );
|
---|
60 | int (*create_thread)( struct wine_pthread_thread_info *info );
|
---|
61 | void (*init_current_teb)( struct wine_pthread_thread_info *info );
|
---|
62 | void * (*get_current_teb)(void);
|
---|
63 | #ifdef __GNUC__
|
---|
64 | void (* __attribute__((noreturn)) exit_thread)( struct wine_pthread_thread_info *info );
|
---|
65 | void (* __attribute__((noreturn)) abort_thread)( long status );
|
---|
66 | #else
|
---|
67 | void (*exit_thread)( struct wine_pthread_thread_info *info );
|
---|
68 | void (*abort_thread)( long status );
|
---|
69 | #endif
|
---|
70 | int (*sigprocmask)( int how, const sigset_t *newset, sigset_t *oldset );
|
---|
71 | };
|
---|
72 |
|
---|
73 | extern void wine_pthread_get_functions( struct wine_pthread_functions *functions, size_t size );
|
---|
74 | extern void wine_pthread_set_functions( const struct wine_pthread_functions *functions, size_t size );
|
---|
75 |
|
---|
76 | #endif /* __WINE_WINE_PTHREAD_H */
|
---|