annotate Include/thread.h @ 8831:00a6bb65ff29 legacy-trunk

Getting rid of this ancient stuff.
author Guido van Rossum <guido@python.org>
date Wed, 05 Aug 1998 21:10:09 +0000
parents bd47ee068b83
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
923
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 #ifndef _THREAD_H_included
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 #define _THREAD_H_included
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1442
diff changeset
4 #define NO_EXIT_PROG /* don't define exit_prog() */
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1442
diff changeset
5 /* (the result is no use of signals on SGI) */
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1442
diff changeset
6
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
7 #ifndef Py_PROTO
1047
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
8 #if defined(__STDC__) || defined(__cplusplus)
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
9 #define Py_PROTO(args) args
923
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 #else
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
11 #define Py_PROTO(args) ()
1442
4749c957466b almodule.c: added close method, equivalent to closeport.
Sjoerd Mullender <sjoerd@acm.org>
parents: 1047
diff changeset
12 #endif
923
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 #endif
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
14
1047
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
15 typedef void *type_lock;
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
16 typedef void *type_sema;
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
17
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
18 #ifdef __cplusplus
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
19 extern "C" {
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
20 #endif
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
21
5194
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
22 /* Macros defining new names for all these symbols */
8822
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
23 /* BeOS note: We have exit_thread(), and no legacy code to
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
24 * support, so we won't allow exit_thread and _exit_thread
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
25 * in here. Actually, I think these #defines should vanish;
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
26 * aren't they cheesy in the face of the Great Renaming? [cjh]
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
27 */
5194
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
28 #define init_thread PyThread_init_thread
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
29 #define start_new_thread PyThread_start_new_thread
8822
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
30 #ifndef __BEOS__
5194
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
31 #define exit_thread PyThread_exit_thread
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
32 #define _exit_thread PyThread__exit_thread
8822
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
33 #endif
5194
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
34 #define get_thread_ident PyThread_get_thread_ident
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
35 #define allocate_lock PyThread_allocate_lock
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
36 #define free_lock PyThread_free_lock
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
37 #define acquire_lock PyThread_acquire_lock
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
38 #define release_lock PyThread_release_lock
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
39 #define allocate_sema PyThread_allocate_sema
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
40 #define free_sema PyThread_free_sema
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
41 #define down_sema PyThread_down_sema
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
42 #define up_sema PyThread_up_sema
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
43 #define exit_prog PyThread_exit_prog
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
44 #define _exit_prog PyThread__exit_prog
5405
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
45 #define create_key PyThread_create_key
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
46 #define delete_key PyThread_delete_key
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
47 #define get_key_value PyThread_get_key_value
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
48 #define set_key_value PyThread_set_key_value
5194
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
49
52f3dc41f6c4 Add Macros defining new names for all external symbols.
Guido van Rossum <guido@python.org>
parents: 4374
diff changeset
50
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
51 void init_thread Py_PROTO((void));
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
52 int start_new_thread Py_PROTO((void (*)(void *), void *));
8822
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
53 #ifndef __BEOS__
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
54 void exit_thread Py_PROTO((void));
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
55 void _exit_thread Py_PROTO((void));
8822
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
56 #else
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
57 void PyThread_exit_thread Py_PROTO((void));
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
58 void PyThread__exit_thread Py_PROTO((void));
bd47ee068b83 Changes for BeOS, QNX and long long, by Chris Herborth.
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
59 #endif
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
60 long get_thread_ident Py_PROTO((void));
923
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
61
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
62 type_lock allocate_lock Py_PROTO((void));
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
63 void free_lock Py_PROTO((type_lock));
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
64 int acquire_lock Py_PROTO((type_lock, int));
923
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 #define WAIT_LOCK 1
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
66 #define NOWAIT_LOCK 0
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
67 void release_lock Py_PROTO((type_lock));
923
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
68
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
69 type_sema allocate_sema Py_PROTO((int));
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
70 void free_sema Py_PROTO((type_sema));
4374
46140f5856d9 Add waitflag to down_sema().
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
71 int down_sema Py_PROTO((type_sema, int));
46140f5856d9 Add waitflag to down_sema().
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
72 #define WAIT_SEMA 1
46140f5856d9 Add waitflag to down_sema().
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
73 #define NOWAIT_SEMA 0
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
74 void up_sema Py_PROTO((type_sema));
961
a31e07847063 New thread.c from Sjoerd, supports _exit_prog(). Use this in goaway()
Guido van Rossum <guido@python.org>
parents: 923
diff changeset
75
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1442
diff changeset
76 #ifndef NO_EXIT_PROG
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
77 void exit_prog Py_PROTO((int));
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
78 void _exit_prog Py_PROTO((int));
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1442
diff changeset
79 #endif
923
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
80
5405
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
81 int create_key Py_PROTO((void));
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
82 void delete_key Py_PROTO((int));
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
83 int set_key_value Py_PROTO((int, void *));
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
84 void * get_key_value Py_PROTO((int));
b7871ca930ad Massive changes for separate thread state management.
Guido van Rossum <guido@python.org>
parents: 5194
diff changeset
85
1047
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
86 #ifdef __cplusplus
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
87 }
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
88 #endif
6b5a34db21fe Added C++ support in thread.h; don't use signals if not strictly
Sjoerd Mullender <sjoerd@acm.org>
parents: 961
diff changeset
89
923
72aceed365d4 * Makefile adapted to changes below.
Guido van Rossum <guido@python.org>
parents:
diff changeset
90 #endif