The 0.5 release happened on 2/15, not on 2/14. :-)
[python/dscho.git] / Include / pythread.h
blobc5048491e4c1428bcb12946d8f7035c88df1118f
1 #ifndef Py_PYTHREAD_H
2 #define Py_PYTHREAD_H
4 /***********************************************************
5 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
6 The Netherlands.
8 All Rights Reserved
10 Permission to use, copy, modify, and distribute this software and its
11 documentation for any purpose and without fee is hereby granted,
12 provided that the above copyright notice appear in all copies and that
13 both that copyright notice and this permission notice appear in
14 supporting documentation, and that the names of Stichting Mathematisch
15 Centrum or CWI or Corporation for National Research Initiatives or
16 CNRI not be used in advertising or publicity pertaining to
17 distribution of the software without specific, written prior
18 permission.
20 While CWI is the initial source for this software, a modified version
21 is made available by the Corporation for National Research Initiatives
22 (CNRI) at the Internet address ftp://ftp.python.org.
24 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
25 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
26 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
27 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
28 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
29 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
30 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
31 PERFORMANCE OF THIS SOFTWARE.
33 ******************************************************************/
35 #define NO_EXIT_PROG /* don't define PyThread_exit_prog() */
36 /* (the result is no use of signals on SGI) */
38 #ifndef Py_PROTO
39 #if defined(__STDC__) || defined(__cplusplus)
40 #define Py_PROTO(args) args
41 #else
42 #define Py_PROTO(args) ()
43 #endif
44 #endif
46 typedef void *PyThread_type_lock;
47 typedef void *PyThread_type_sema;
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
53 DL_IMPORT(void) PyThread_init_thread Py_PROTO((void));
54 DL_IMPORT(int) PyThread_start_new_thread Py_PROTO((void (*)(void *), void *));
55 DL_IMPORT(void) PyThread_exit_thread Py_PROTO((void));
56 DL_IMPORT(void) PyThread__PyThread_exit_thread Py_PROTO((void));
57 DL_IMPORT(long) PyThread_get_thread_ident Py_PROTO((void));
59 DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock Py_PROTO((void));
60 DL_IMPORT(void) PyThread_free_lock Py_PROTO((PyThread_type_lock));
61 DL_IMPORT(int) PyThread_acquire_lock Py_PROTO((PyThread_type_lock, int));
62 #define WAIT_LOCK 1
63 #define NOWAIT_LOCK 0
64 DL_IMPORT(void) PyThread_release_lock Py_PROTO((PyThread_type_lock));
66 DL_IMPORT(PyThread_type_sema) PyThread_allocate_sema Py_PROTO((int));
67 DL_IMPORT(void) PyThread_free_sema Py_PROTO((PyThread_type_sema));
68 DL_IMPORT(int) PyThread_down_sema Py_PROTO((PyThread_type_sema, int));
69 #define WAIT_SEMA 1
70 #define NOWAIT_SEMA 0
71 DL_IMPORT(void) PyThread_up_sema Py_PROTO((PyThread_type_sema));
73 #ifndef NO_EXIT_PROG
74 DL_IMPORT(void) PyThread_exit_prog Py_PROTO((int));
75 DL_IMPORT(void) PyThread__PyThread_exit_prog Py_PROTO((int));
76 #endif
78 DL_IMPORT(int) PyThread_create_key Py_PROTO((void));
79 DL_IMPORT(void) PyThread_delete_key Py_PROTO((int));
80 DL_IMPORT(int) PyThread_set_key_value Py_PROTO((int, void *));
81 DL_IMPORT(void *) PyThread_get_key_value Py_PROTO((int));
83 #ifdef __cplusplus
85 #endif
87 #endif /* !Py_PYTHREAD_H */