annotate Python/thread_os2.h @ 33940:dfd07b7be407 legacy-trunk

SF bug 1061968: threads: segfault or Py_FatalError at exit PyGILState_Ensure(): The fix in 2.4a3 for bug 1010677 reintroduced thread shutdown race bug 225673. Repaired by (once again) ensuring the GIL is held whenever deleting a thread state. Alas, there's no useful test case for this shy bug. Four years ago, only Guido could provoke it, on his box, and today only Armin can provoke it on his box. I've never been able to provoke it (but not for lack of trying!). This is a critical fix for 2.3.5 too, since the fix for 1010677 got backported there already and so also reintroduced 225673. I don't intend to backport this fix. For whoever (if anyone) does, there are other thread fixes in 2.4 that need backporting too, and I bet they need to happen first for this patch to apply cleanly.
author Tim Peters <tim.peters@gmail.com>
date Mon, 08 Nov 2004 04:30:21 +0000
parents 8e1567dbcba8
children e1a7eb832cb5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 /* This code implemented by cvale@netcom.com */
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
2
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 #define INCL_DOSPROCESS
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 #define INCL_DOSSEMAPHORES
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 #include "os2.h"
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 #include "limits.h"
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 #include "process.h"
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
10 #if defined(PYCC_GCC)
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
11 #include <sys/builtin.h>
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
12 #include <sys/fmutex.h>
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
13 #else
9679
877d23bd5bdc Thanks to Chris Herborth, the thread primitives now have proper Py*
Guido van Rossum <guido@python.org>
parents: 6626
diff changeset
14 long PyThread_get_thread_ident(void);
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
15 #endif
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
16
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 /*
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 * Initialization of the C package, should not be needed.
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 */
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
20 static void
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
21 PyThread__init_thread(void)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 {
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
24
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 /*
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 * Thread support.
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 */
20468
ebfd87e87884 Partial patch from SF #452266, by Jason Petrone.
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
28 long
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
29 PyThread_start_new_thread(void (*func)(void *), void *arg)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 {
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
31 int aThread;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
32 int success = 0;
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
33
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
34 aThread = _beginthread(func,NULL,65536,arg);
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
35
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
36 if (aThread == -1) {
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
37 success = -1;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
38 fprintf(stderr, "aThread failed == %d", aThread);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
39 dprintf(("_beginthread failed. return %ld\n", errno));
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
40 }
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
41
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
42 return success;
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
44
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
45 long
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
46 PyThread_get_thread_ident(void)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
47 {
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
48 #if !defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
49 PPIB pib;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
50 PTIB tib;
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
51 #endif
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
52
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
53 if (!initialized)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
54 PyThread_init_thread();
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
55
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
56 #if defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
57 return _gettid();
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
58 #else
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
59 DosGetInfoBlocks(&tib, &pib);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
60 return tib->tib_ptib2->tib2_ultid;
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
61 #endif
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
62 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
63
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
64 static void
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
65 do_PyThread_exit_thread(int no_cleanup)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
66 {
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
67 dprintf(("%ld: PyThread_exit_thread called\n",
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
68 PyThread_get_thread_ident()));
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
69 if (!initialized)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
70 if (no_cleanup)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
71 _exit(0);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
72 else
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
73 exit(0);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
74 _endthread();
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
75 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
76
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
77 void
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
78 PyThread_exit_thread(void)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
79 {
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
80 do_PyThread_exit_thread(0);
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
81 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
82
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
83 void
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
84 PyThread__exit_thread(void)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
85 {
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
86 do_PyThread_exit_thread(1);
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
87 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
88
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
89 #ifndef NO_EXIT_PROG
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
90 static void
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
91 do_PyThread_exit_prog(int status, int no_cleanup)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
92 {
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
93 dprintf(("PyThread_exit_prog(%d) called\n", status));
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
94 if (!initialized)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
95 if (no_cleanup)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
96 _exit(status);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
97 else
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
98 exit(status);
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
99 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
100
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
101 void
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
102 PyThread_exit_prog(int status)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
103 {
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
104 do_PyThread_exit_prog(status, 0);
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
105 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
106
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
107 void
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
108 PyThread__exit_prog(int status)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
109 {
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
110 do_PyThread_exit_prog(status, 1);
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
111 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
112 #endif /* NO_EXIT_PROG */
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
113
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
114 /*
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
115 * Lock support. This is implemented with an event semaphore and critical
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
116 * sections to make it behave more like a posix mutex than its OS/2
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
117 * counterparts.
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
118 */
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
119
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
120 typedef struct os2_lock_t {
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
121 int is_set;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
122 HEV changed;
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
123 } *type_os2_lock;
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
124
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
125 PyThread_type_lock
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
126 PyThread_allocate_lock(void)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
127 {
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
128 #if defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
129 _fmutex *sem = malloc(sizeof(_fmutex));
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
130 if (!initialized)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
131 PyThread_init_thread();
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
132 dprintf(("%ld: PyThread_allocate_lock() -> %lx\n",
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
133 PyThread_get_thread_ident(),
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
134 (long)sem));
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
135 if (_fmutex_create(sem, 0)) {
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
136 free(sem);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
137 sem = NULL;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
138 }
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
139 return (PyThread_type_lock)sem;
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
140 #else
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
141 APIRET rc;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
142 type_os2_lock lock = (type_os2_lock)malloc(sizeof(struct os2_lock_t));
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
143
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
144 dprintf(("PyThread_allocate_lock called\n"));
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
145 if (!initialized)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
146 PyThread_init_thread();
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
147
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
148 lock->is_set = 0;
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
149
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
150 DosCreateEventSem(NULL, &lock->changed, 0, 0);
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
151
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
152 dprintf(("%ld: PyThread_allocate_lock() -> %p\n",
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
153 PyThread_get_thread_ident(),
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
154 lock->changed));
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
155
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
156 return (PyThread_type_lock)lock;
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
157 #endif
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
158 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
159
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
160 void
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
161 PyThread_free_lock(PyThread_type_lock aLock)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
162 {
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
163 #if !defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
164 type_os2_lock lock = (type_os2_lock)aLock;
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
165 #endif
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
166
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
167 dprintf(("%ld: PyThread_free_lock(%p) called\n",
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
168 PyThread_get_thread_ident(),aLock));
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
169
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
170 #if defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
171 if (aLock) {
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
172 _fmutex_close((_fmutex *)aLock);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
173 free((_fmutex *)aLock);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
174 }
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
175 #else
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
176 DosCloseEventSem(lock->changed);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
177 free(aLock);
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
178 #endif
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
179 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
180
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
181 /*
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
182 * Return 1 on success if the lock was acquired
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
183 *
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
184 * and 0 if the lock was not acquired.
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
185 */
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
186 int
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13620
diff changeset
187 PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
188 {
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
189 #if !defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
190 int done = 0;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
191 ULONG count;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
192 PID pid = 0;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
193 TID tid = 0;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
194 type_os2_lock lock = (type_os2_lock)aLock;
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
195 #endif
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
196
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
197 dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n",
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
198 PyThread_get_thread_ident(),
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
199 aLock,
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
200 waitflag));
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
201
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
202 #if defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
203 /* always successful if the lock doesn't exist */
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
204 if (aLock &&
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
205 _fmutex_request((_fmutex *)aLock, waitflag ? 0 : _FMR_NOWAIT))
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
206 return 0;
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
207 #else
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
208 while (!done) {
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
209 /* if the lock is currently set, we have to wait for
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
210 * the state to change
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
211 */
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
212 if (lock->is_set) {
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
213 if (!waitflag)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
214 return 0;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
215 DosWaitEventSem(lock->changed, SEM_INDEFINITE_WAIT);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
216 }
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
217
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
218 /* enter a critical section and try to get the semaphore. If
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
219 * it is still locked, we will try again.
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
220 */
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
221 if (DosEnterCritSec())
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
222 return 0;
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
223
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
224 if (!lock->is_set) {
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
225 lock->is_set = 1;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
226 DosResetEventSem(lock->changed, &count);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
227 done = 1;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
228 }
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
229
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
230 DosExitCritSec();
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
231 }
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
232 #endif
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
233
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
234 return 1;
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
235 }
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
236
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
237 void PyThread_release_lock(PyThread_type_lock aLock)
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
238 {
26530
b5837b8f3b2c typo fix: declaration required for VACPP not EMX+gcc
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 22054
diff changeset
239 #if !defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
240 type_os2_lock lock = (type_os2_lock)aLock;
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
241 #endif
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
242
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
243 dprintf(("%ld: PyThread_release_lock(%p) called\n",
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
244 PyThread_get_thread_ident(),
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
245 aLock));
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
246
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
247 #if defined(PYCC_GCC)
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
248 if (aLock)
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
249 _fmutex_release((_fmutex *)aLock);
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
250 #else
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
251 if (!lock->is_set) {
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
252 dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
253 PyThread_get_thread_ident(),
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
254 aLock,
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
255 GetLastError()));
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
256 return;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
257 }
20782
b1d9029e09d1 SF patch #474500: Make OS/2 locks work like posix locks, from Michael
Tim Peters <tim.peters@gmail.com>
parents: 20468
diff changeset
258
26531
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
259 if (DosEnterCritSec()) {
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
260 dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
261 PyThread_get_thread_ident(),
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
262 aLock,
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
263 GetLastError()));
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
264 return;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
265 }
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
266
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
267 lock->is_set = 0;
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
268 DosPostEventSem(lock->changed);
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
269
8e1567dbcba8 reformat for PEP-7 style conformance
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 26530
diff changeset
270 DosExitCritSec();
22054
5cbcfde3ad55 OS/2 EMX port changes (Python part of patch #450267):
Andrew MacIntyre <andymac@bullseye.apana.org.au>
parents: 21766
diff changeset
271 #endif
2649
063a96b49b3e OS/2 thread support
Guido van Rossum <guido@python.org>
parents:
diff changeset
272 }