Skip to content

Commit 72aee3d

Browse files
committed
Merged revisions 78393 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78393 | amaury.forgeotdarc | 2010-02-24 00:19:39 +0100 (mer., 24 févr. 2010) | 2 lines python#4852: Remove dead code in every thread implementation, unused for many years. ........
1 parent 640cacb commit 72aee3d

File tree

14 files changed

+24
-491
lines changed

14 files changed

+24
-491
lines changed

Include/pythread.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#ifndef Py_PYTHREAD_H
33
#define Py_PYTHREAD_H
44

5-
#define NO_EXIT_PROG /* don't define PyThread_exit_prog() */
6-
/* (the result is no use of signals on SGI) */
7-
85
typedef void *PyThread_type_lock;
96
typedef void *PyThread_type_sema;
107

@@ -15,7 +12,6 @@ extern "C" {
1512
PyAPI_FUNC(void) PyThread_init_thread(void);
1613
PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *);
1714
PyAPI_FUNC(void) PyThread_exit_thread(void);
18-
PyAPI_FUNC(void) PyThread__PyThread_exit_thread(void);
1915
PyAPI_FUNC(long) PyThread_get_thread_ident(void);
2016

2117
PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void);
@@ -28,11 +24,6 @@ PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
2824
PyAPI_FUNC(size_t) PyThread_get_stacksize(void);
2925
PyAPI_FUNC(int) PyThread_set_stacksize(size_t);
3026

31-
#ifndef NO_EXIT_PROG
32-
PyAPI_FUNC(void) PyThread_exit_prog(int);
33-
PyAPI_FUNC(void) PyThread__PyThread_exit_prog(int);
34-
#endif
35-
3627
/* Thread Local Storage (TLS) API */
3728
PyAPI_FUNC(int) PyThread_create_key(void);
3829
PyAPI_FUNC(void) PyThread_delete_key(int);

Modules/_threadmodule.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -825,18 +825,6 @@ Raise a KeyboardInterrupt in the main thread.\n\
825825
A subthread can use this function to interrupt the main thread."
826826
);
827827

828-
#ifndef NO_EXIT_PROG
829-
static PyObject *
830-
thread_PyThread_exit_prog(PyObject *self, PyObject *args)
831-
{
832-
int sts;
833-
if (!PyArg_ParseTuple(args, "i:exit_prog", &sts))
834-
return NULL;
835-
Py_Exit(sts); /* Calls PyThread_exit_prog(sts) or _PyThread_exit_prog(sts) */
836-
for (;;) { } /* Should not be reached */
837-
}
838-
#endif
839-
840828
static lockobject *newlockobject(void);
841829

842830
static PyObject *
@@ -970,10 +958,6 @@ static PyMethodDef thread_methods[] = {
970958
{"stack_size", (PyCFunction)thread_stack_size,
971959
METH_VARARGS,
972960
stack_size_doc},
973-
#ifndef NO_EXIT_PROG
974-
{"exit_prog", (PyCFunction)thread_PyThread_exit_prog,
975-
METH_VARARGS},
976-
#endif
977961
{NULL, NULL} /* sentinel */
978962
};
979963

PC/os2emx/python27.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,6 @@ EXPORTS
11681168
"PyThread_delete_key"
11691169
"PyThread_set_key_value"
11701170
"PyThread_get_key_value"
1171-
"PyThread__exit_thread"
11721171

11731172
; From python26_s.lib(gcmodule)
11741173
; "initgc"

PC/os2vacpp/python.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ EXPORTS
376376
PyThreadState_GetDict
377377
PyThreadState_New
378378
PyThreadState_Swap
379-
PyThread__exit_thread
380379
PyThread_acquire_lock
381380
PyThread_allocate_lock
382381
PyThread_allocate_sema

Python/thread_cthread.h

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -50,58 +50,14 @@ PyThread_get_thread_ident(void)
5050
return (long) cthread_self();
5151
}
5252

53-
static void
54-
do_PyThread_exit_thread(int no_cleanup)
55-
{
56-
dprintf(("PyThread_exit_thread called\n"));
57-
if (!initialized)
58-
if (no_cleanup)
59-
_exit(0);
60-
else
61-
exit(0);
62-
cthread_exit(0);
63-
}
64-
6553
void
6654
PyThread_exit_thread(void)
6755
{
68-
do_PyThread_exit_thread(0);
69-
}
70-
71-
void
72-
PyThread__exit_thread(void)
73-
{
74-
do_PyThread_exit_thread(1);
75-
}
76-
77-
#ifndef NO_EXIT_PROG
78-
static
79-
void do_PyThread_exit_prog(int status, int no_cleanup)
80-
{
81-
dprintf(("PyThread_exit_prog(%d) called\n", status));
56+
dprintf(("PyThread_exit_thread called\n"));
8257
if (!initialized)
83-
if (no_cleanup)
84-
_exit(status);
85-
else
86-
exit(status);
87-
if (no_cleanup)
88-
_exit(status);
89-
else
90-
exit(status);
91-
}
92-
93-
void
94-
PyThread_exit_prog(int status)
95-
{
96-
do_PyThread_exit_prog(status, 0);
97-
}
98-
99-
void
100-
PyThread__exit_prog(int status)
101-
{
102-
do_PyThread_exit_prog(status, 1);
58+
exit(0);
59+
cthread_exit(0);
10360
}
104-
#endif /* NO_EXIT_PROG */
10561

10662
/*
10763
* Lock support.

Python/thread_foobar.h

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,53 +29,13 @@ PyThread_get_thread_ident(void)
2929
PyThread_init_thread();
3030
}
3131

32-
static
33-
void do_PyThread_exit_thread(int no_cleanup)
34-
{
35-
dprintf(("PyThread_exit_thread called\n"));
36-
if (!initialized)
37-
if (no_cleanup)
38-
_exit(0);
39-
else
40-
exit(0);
41-
}
42-
4332
void
4433
PyThread_exit_thread(void)
4534
{
46-
do_PyThread_exit_thread(0);
47-
}
48-
49-
void
50-
PyThread__exit_thread(void)
51-
{
52-
do_PyThread_exit_thread(1);
53-
}
54-
55-
#ifndef NO_EXIT_PROG
56-
static
57-
void do_PyThread_exit_prog(int status, int no_cleanup)
58-
{
59-
dprintf(("PyThread_exit_prog(%d) called\n", status));
35+
dprintf(("PyThread_exit_thread called\n"));
6036
if (!initialized)
61-
if (no_cleanup)
62-
_exit(status);
63-
else
64-
exit(status);
65-
}
66-
67-
void
68-
PyThread_exit_prog(int status)
69-
{
70-
do_PyThread_exit_prog(status, 0);
71-
}
72-
73-
void
74-
PyThread__exit_prog(int status)
75-
{
76-
do_PyThread_exit_prog(status, 1);
37+
exit(0);
7738
}
78-
#endif /* NO_EXIT_PROG */
7939

8040
/*
8141
* Lock support.

Python/thread_lwp.h

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,50 +47,14 @@ long PyThread_get_thread_ident(void)
4747
return tid.thread_id;
4848
}
4949

50-
static void do_PyThread_exit_thread(int no_cleanup)
50+
void PyThread_exit_thread(void)
5151
{
5252
dprintf(("PyThread_exit_thread called\n"));
5353
if (!initialized)
54-
if (no_cleanup)
55-
_exit(0);
56-
else
57-
exit(0);
54+
exit(0);
5855
lwp_destroy(SELF);
5956
}
6057

61-
void PyThread_exit_thread(void)
62-
{
63-
do_PyThread_exit_thread(0);
64-
}
65-
66-
void PyThread__exit_thread(void)
67-
{
68-
do_PyThread_exit_thread(1);
69-
}
70-
71-
#ifndef NO_EXIT_PROG
72-
static void do_PyThread_exit_prog(int status, int no_cleanup)
73-
{
74-
dprintf(("PyThread_exit_prog(%d) called\n", status));
75-
if (!initialized)
76-
if (no_cleanup)
77-
_exit(status);
78-
else
79-
exit(status);
80-
pod_exit(status);
81-
}
82-
83-
void PyThread_exit_prog(int status)
84-
{
85-
do_PyThread_exit_prog(status, 0);
86-
}
87-
88-
void PyThread__exit_prog(int status)
89-
{
90-
do_PyThread_exit_prog(status, 1);
91-
}
92-
#endif /* NO_EXIT_PROG */
93-
9458
/*
9559
* Lock support.
9660
*/

Python/thread_nt.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,6 @@ PyThread_exit_thread(void)
203203
#endif
204204
}
205205

206-
#ifndef NO_EXIT_PROG
207-
void
208-
PyThread_exit_prog(int status)
209-
{
210-
dprintf(("PyThread_exit_prog(%d) called\n", status));
211-
if (!initialized)
212-
exit(status);
213-
}
214-
#endif /* NO_EXIT_PROG */
215-
216206
/*
217207
* Lock support. It has too be implemented as semaphores.
218208
* I [Dag] tried to implement it with mutex but I could find a way to

Python/thread_os2.h

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -68,56 +68,16 @@ PyThread_get_thread_ident(void)
6868
#endif
6969
}
7070

71-
static void
72-
do_PyThread_exit_thread(int no_cleanup)
71+
void
72+
PyThread_exit_thread(void)
7373
{
7474
dprintf(("%ld: PyThread_exit_thread called\n",
7575
PyThread_get_thread_ident()));
7676
if (!initialized)
77-
if (no_cleanup)
78-
_exit(0);
79-
else
80-
exit(0);
77+
exit(0);
8178
_endthread();
8279
}
8380

84-
void
85-
PyThread_exit_thread(void)
86-
{
87-
do_PyThread_exit_thread(0);
88-
}
89-
90-
void
91-
PyThread__exit_thread(void)
92-
{
93-
do_PyThread_exit_thread(1);
94-
}
95-
96-
#ifndef NO_EXIT_PROG
97-
static void
98-
do_PyThread_exit_prog(int status, int no_cleanup)
99-
{
100-
dprintf(("PyThread_exit_prog(%d) called\n", status));
101-
if (!initialized)
102-
if (no_cleanup)
103-
_exit(status);
104-
else
105-
exit(status);
106-
}
107-
108-
void
109-
PyThread_exit_prog(int status)
110-
{
111-
do_PyThread_exit_prog(status, 0);
112-
}
113-
114-
void
115-
PyThread__exit_prog(int status)
116-
{
117-
do_PyThread_exit_prog(status, 1);
118-
}
119-
#endif /* NO_EXIT_PROG */
120-
12181
/*
12282
* Lock support. This is implemented with an event semaphore and critical
12383
* sections to make it behave more like a posix mutex than its OS/2

Python/thread_pth.h

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -74,49 +74,14 @@ long PyThread_get_thread_ident(void)
7474
return (long) *(long *) &threadid;
7575
}
7676

77-
static void do_PyThread_exit_thread(int no_cleanup)
77+
void PyThread_exit_thread(void)
7878
{
7979
dprintf(("PyThread_exit_thread called\n"));
8080
if (!initialized) {
81-
if (no_cleanup)
82-
_exit(0);
83-
else
84-
exit(0);
81+
exit(0);
8582
}
8683
}
8784

88-
void PyThread_exit_thread(void)
89-
{
90-
do_PyThread_exit_thread(0);
91-
}
92-
93-
void PyThread__exit_thread(void)
94-
{
95-
do_PyThread_exit_thread(1);
96-
}
97-
98-
#ifndef NO_EXIT_PROG
99-
static void do_PyThread_exit_prog(int status, int no_cleanup)
100-
{
101-
dprintf(("PyThread_exit_prog(%d) called\n", status));
102-
if (!initialized)
103-
if (no_cleanup)
104-
_exit(status);
105-
else
106-
exit(status);
107-
}
108-
109-
void PyThread_exit_prog(int status)
110-
{
111-
do_PyThread_exit_prog(status, 0);
112-
}
113-
114-
void PyThread__exit_prog(int status)
115-
{
116-
do_PyThread_exit_prog(status, 1);
117-
}
118-
#endif /* NO_EXIT_PROG */
119-
12085
/*
12186
* Lock support.
12287
*/

0 commit comments

Comments
 (0)