| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,9 +2,6 @@ | |||
| 2 | 2 | #ifndef Py_PYTHREAD_H | |
| 3 | 3 | #define Py_PYTHREAD_H | |
| 4 | 4 | ||
| 5 | - #define NO_EXIT_PROG /* don't define PyThread_exit_prog() */ | ||
| 6 | - /* (the result is no use of signals on SGI) */ | ||
| 7 | - | ||
| 8 | 5 | typedef void *PyThread_type_lock; | |
| 9 | 6 | typedef void *PyThread_type_sema; | |
| 10 | 7 | ||
@@ -15,7 +12,6 @@ extern "C" { | |||
| 15 | 12 | PyAPI_FUNC(void) PyThread_init_thread(void); | |
| 16 | 13 | PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *); | |
| 17 | 14 | PyAPI_FUNC(void) PyThread_exit_thread(void); | |
| 18 | - PyAPI_FUNC(void) PyThread__PyThread_exit_thread(void); | ||
| 19 | 15 | PyAPI_FUNC(long) PyThread_get_thread_ident(void); | |
| 20 | 16 | ||
| 21 | 17 | PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void); | |
@@ -28,11 +24,6 @@ PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock); | |||
| 28 | 24 | PyAPI_FUNC(size_t) PyThread_get_stacksize(void); | |
| 29 | 25 | PyAPI_FUNC(int) PyThread_set_stacksize(size_t); | |
| 30 | 26 | ||
| 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 | - | ||
| 36 | 27 | /* Thread Local Storage (TLS) API */ | |
| 37 | 28 | PyAPI_FUNC(int) PyThread_create_key(void); | |
| 38 | 29 | PyAPI_FUNC(void) PyThread_delete_key(int); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -558,18 +558,6 @@ Raise a KeyboardInterrupt in the main thread.\n\ | |||
| 558 | 558 | A subthread can use this function to interrupt the main thread." | |
| 559 | 559 | ); | |
| 560 | 560 | ||
| 561 | - #ifndef NO_EXIT_PROG | ||
| 562 | - static PyObject * | ||
| 563 | - thread_PyThread_exit_prog(PyObject *self, PyObject *args) | ||
| 564 | - { | ||
| 565 | - int sts; | ||
| 566 | - if (!PyArg_ParseTuple(args, "i:exit_prog", &sts)) | ||
| 567 | - return NULL; | ||
| 568 | - Py_Exit(sts); /* Calls PyThread_exit_prog(sts) or _PyThread_exit_prog(sts) */ | ||
| 569 | - for (;;) { } /* Should not be reached */ | ||
| 570 | - } | ||
| 571 | - #endif | ||
| 572 | - | ||
| 573 | 561 | static lockobject *newlockobject(void); | |
| 574 | 562 | ||
| 575 | 563 | static PyObject * | |
@@ -703,10 +691,6 @@ static PyMethodDef thread_methods[] = { | |||
| 703 | 691 | {"stack_size", (PyCFunction)thread_stack_size, | |
| 704 | 692 | METH_VARARGS, | |
| 705 | 693 | stack_size_doc}, | |
| 706 | - #ifndef NO_EXIT_PROG | ||
| 707 | - {"exit_prog", (PyCFunction)thread_PyThread_exit_prog, | ||
| 708 | - METH_VARARGS}, | ||
| 709 | - #endif | ||
| 710 | 694 | {NULL, NULL} /* sentinel */ | |
| 711 | 695 | }; | |
| 712 | 696 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1160,7 +1160,6 @@ EXPORTS | |||
| 1160 | 1160 | "PyThread_delete_key" | |
| 1161 | 1161 | "PyThread_set_key_value" | |
| 1162 | 1162 | "PyThread_get_key_value" | |
| 1163 | - "PyThread__exit_thread" | ||
| 1164 | 1163 | ||
| 1165 | 1164 | ; From python27_s.lib(gcmodule) | |
| 1166 | 1165 | ; "initgc" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -368,7 +368,6 @@ EXPORTS | |||
| 368 | 368 | PyThreadState_GetDict | |
| 369 | 369 | PyThreadState_New | |
| 370 | 370 | PyThreadState_Swap | |
| 371 | - PyThread__exit_thread | ||
| 372 | 371 | PyThread_acquire_lock | |
| 373 | 372 | PyThread_allocate_lock | |
| 374 | 373 | PyThread_allocate_sema | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -128,62 +128,21 @@ long PyThread_get_thread_ident(void) | |||
| 128 | 128 | } | |
| 129 | 129 | ||
| 130 | 130 | ||
| 131 | - static void do_PyThread_exit_thread(int no_cleanup) | ||
| 131 | + void PyThread_exit_thread(void) | ||
| 132 | 132 | { | |
| 133 | 133 | dprintf(("PyThread_exit_thread called\n")); | |
| 134 | 134 | ||
| 135 | 135 | /* Thread-safe way to read a variable without a mutex: */ | |
| 136 | 136 | if (atomic_add(&thread_count, 0) == 0) { | |
| 137 | 137 | /* No threads around, so exit main(). */ | |
| 138 | - if (no_cleanup) | ||
| 139 | - _exit(0); | ||
| 140 | - else | ||
| 141 | - exit(0); | ||
| 138 | + exit(0); | ||
| 142 | 139 | } else { | |
| 143 | 140 | /* We're a thread */ | |
| 144 | 141 | exit_thread(0); | |
| 145 | 142 | } | |
| 146 | 143 | } | |
| 147 | 144 | ||
| 148 | 145 | ||
| 149 | - void PyThread_exit_thread(void) | ||
| 150 | - { | ||
| 151 | - do_PyThread_exit_thread(0); | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - | ||
| 155 | - void PyThread__exit_thread(void) | ||
| 156 | - { | ||
| 157 | - do_PyThread_exit_thread(1); | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - | ||
| 161 | - #ifndef NO_EXIT_PROG | ||
| 162 | - static void do_PyThread_exit_prog(int status, int no_cleanup) | ||
| 163 | - { | ||
| 164 | - dprintf(("PyThread_exit_prog(%d) called\n", status)); | ||
| 165 | - | ||
| 166 | - /* No need to do anything, the threads get torn down if main()exits. */ | ||
| 167 | - if (no_cleanup) | ||
| 168 | - _exit(status); | ||
| 169 | - else | ||
| 170 | - exit(status); | ||
| 171 | - } | ||
| 172 | - | ||
| 173 | - | ||
| 174 | - void PyThread_exit_prog(int status) | ||
| 175 | - { | ||
| 176 | - do_PyThread_exit_prog(status, 0); | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - | ||
| 180 | - void PyThread__exit_prog(int status) | ||
| 181 | - { | ||
| 182 | - do_PyThread_exit_prog(status, 1); | ||
| 183 | - } | ||
| 184 | - #endif /* NO_EXIT_PROG */ | ||
| 185 | - | ||
| 186 | - | ||
| 187 | 146 | /* | |
| 188 | 147 | * Lock support. | |
| 189 | 148 | * | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -144,7 +144,7 @@ long PyThread_get_thread_ident( void ) | |||
| 144 | 144 | return ( tid != B_NAME_NOT_FOUND ? tid : -1 ); | |
| 145 | 145 | } | |
| 146 | 146 | ||
| 147 | - static void do_PyThread_exit_thread( int no_cleanup ) | ||
| 147 | + void PyThread_exit_thread( void ) | ||
| 148 | 148 | { | |
| 149 | 149 | int32 threads; | |
| 150 | 150 | ||
@@ -155,52 +155,13 @@ static void do_PyThread_exit_thread( int no_cleanup ) | |||
| 155 | 155 | ||
| 156 | 156 | if( threads == 0 ) { | |
| 157 | 157 | /* No threads around, so exit main(). */ | |
| 158 | - if( no_cleanup ) { | ||
| 159 | - _exit(0); | ||
| 160 | - } else { | ||
| 161 | - exit(0); | ||
| 162 | - } | ||
| 158 | + exit(0); | ||
| 163 | 159 | } else { | |
| 164 | 160 | /* Oh, we're a thread, let's try to exit gracefully... */ | |
| 165 | 161 | exit_thread( B_NO_ERROR ); | |
| 166 | 162 | } | |
| 167 | 163 | } | |
| 168 | 164 | ||
| 169 | - void PyThread_exit_thread( void ) | ||
| 170 | - { | ||
| 171 | - do_PyThread_exit_thread(0); | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - void PyThread__exit_thread( void ) | ||
| 175 | - { | ||
| 176 | - do_PyThread_exit_thread(1); | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - #ifndef NO_EXIT_PROG | ||
| 180 | - static void do_PyThread_exit_prog( int status, int no_cleanup ) | ||
| 181 | - { | ||
| 182 | - dprintf(("PyThread_exit_prog(%d) called\n", status)); | ||
| 183 | - | ||
| 184 | - /* No need to do anything, the threads get torn down if main() exits. */ | ||
| 185 | - | ||
| 186 | - if (no_cleanup) { | ||
| 187 | - _exit(status); | ||
| 188 | - } else { | ||
| 189 | - exit(status); | ||
| 190 | - } | ||
| 191 | - } | ||
| 192 | - | ||
| 193 | - void PyThread_exit_prog( int status ) | ||
| 194 | - { | ||
| 195 | - do_PyThread_exit_prog(status, 0); | ||
| 196 | - } | ||
| 197 | - | ||
| 198 | - void PyThread__exit_prog( int status ) | ||
| 199 | - { | ||
| 200 | - do_PyThread_exit_prog(status, 1); | ||
| 201 | - } | ||
| 202 | - #endif /* NO_EXIT_PROG */ | ||
| 203 | - | ||
| 204 | 165 | /* ---------------------------------------------------------------------- | |
| 205 | 166 | * Lock support. | |
| 206 | 167 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,58 +50,14 @@ PyThread_get_thread_ident(void) | |||
| 50 | 50 | return (long) cthread_self(); | |
| 51 | 51 | } | |
| 52 | 52 | ||
| 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 | - | ||
| 65 | 53 | void | |
| 66 | 54 | PyThread_exit_thread(void) | |
| 67 | 55 | { | |
| 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")); | ||
| 82 | 57 | 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); | ||
| 103 | 60 | } | |
| 104 | - #endif /* NO_EXIT_PROG */ | ||
| 105 | 61 | ||
| 106 | 62 | /* | |
| 107 | 63 | * Lock support. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,53 +29,13 @@ PyThread_get_thread_ident(void) | |||
| 29 | 29 | PyThread_init_thread(); | |
| 30 | 30 | } | |
| 31 | 31 | ||
| 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 | - | ||
| 43 | 32 | void | |
| 44 | 33 | PyThread_exit_thread(void) | |
| 45 | 34 | { | |
| 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")); | ||
| 60 | 36 | 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); | ||
| 77 | 38 | } | |
| 78 | - #endif /* NO_EXIT_PROG */ | ||
| 79 | 39 | ||
| 80 | 40 | /* | |
| 81 | 41 | * Lock support. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,50 +47,14 @@ long PyThread_get_thread_ident(void) | |||
| 47 | 47 | return tid.thread_id; | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | - static void do_PyThread_exit_thread(int no_cleanup) | ||
| 50 | + void PyThread_exit_thread(void) | ||
| 51 | 51 | { | |
| 52 | 52 | dprintf(("PyThread_exit_thread called\n")); | |
| 53 | 53 | if (!initialized) | |
| 54 | - if (no_cleanup) | ||
| 55 | - _exit(0); | ||
| 56 | - else | ||
| 57 | - exit(0); | ||
| 54 | + exit(0); | ||
| 58 | 55 | lwp_destroy(SELF); | |
| 59 | 56 | } | |
| 60 | 57 | ||
| 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 | - | ||
| 94 | 58 | /* | |
| 95 | 59 | * Lock support. | |
| 96 | 60 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -203,16 +203,6 @@ PyThread_exit_thread(void) | |||
| 203 | 203 | #endif | |
| 204 | 204 | } | |
| 205 | 205 | ||
| 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 | - | ||
| 216 | 206 | /* | |
| 217 | 207 | * Lock support. It has too be implemented as semaphores. | |
| 218 | 208 | * I [Dag] tried to implement it with mutex but I could find a way to | |
| Back | FazBrowse Home | New Git URL |
0 commit comments