| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 14f53a7 commit 65d5b57
20 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | #ifndef _THREAD_H_included | |
| 2 | 2 | #define _THREAD_H_included | |
| 3 | 3 | ||
| 4 | - #define NO_EXIT_PROG /* don't define exit_prog() */ | ||
| 4 | + #define NO_EXIT_PROG /* don't define PyThread_exit_prog() */ | ||
| 5 | 5 | /* (the result is no use of signals on SGI) */ | |
| 6 | 6 | ||
| 7 | 7 | #ifndef Py_PROTO | |
@@ -12,76 +12,42 @@ | |||
| 12 | 12 | #endif | |
| 13 | 13 | #endif | |
| 14 | 14 | ||
| 15 | - typedef void *type_lock; | ||
| 16 | - typedef void *type_sema; | ||
| 15 | + typedef void *PyThread_type_lock; | ||
| 16 | + typedef void *PyThread_type_sema; | ||
| 17 | 17 | ||
| 18 | 18 | #ifdef __cplusplus | |
| 19 | 19 | extern "C" { | |
| 20 | 20 | #endif | |
| 21 | 21 | ||
| 22 | - /* Macros defining new names for all these symbols */ | ||
| 23 | - /* BeOS note: We have exit_thread(), and no legacy code to | ||
| 24 | - * support, so we won't allow exit_thread and _exit_thread | ||
| 25 | - * in here. Actually, I think these #defines should vanish; | ||
| 26 | - * aren't they cheesy in the face of the Great Renaming? [cjh] | ||
| 27 | - */ | ||
| 28 | - #define init_thread PyThread_init_thread | ||
| 29 | - #define start_new_thread PyThread_start_new_thread | ||
| 30 | - #ifndef __BEOS__ | ||
| 31 | - #define exit_thread PyThread_exit_thread | ||
| 32 | - #define _exit_thread PyThread__exit_thread | ||
| 33 | - #endif | ||
| 34 | - #define get_thread_ident PyThread_get_thread_ident | ||
| 35 | - #define allocate_lock PyThread_allocate_lock | ||
| 36 | - #define free_lock PyThread_free_lock | ||
| 37 | - #define acquire_lock PyThread_acquire_lock | ||
| 38 | - #define release_lock PyThread_release_lock | ||
| 39 | - #define allocate_sema PyThread_allocate_sema | ||
| 40 | - #define free_sema PyThread_free_sema | ||
| 41 | - #define down_sema PyThread_down_sema | ||
| 42 | - #define up_sema PyThread_up_sema | ||
| 43 | - #define exit_prog PyThread_exit_prog | ||
| 44 | - #define _exit_prog PyThread__exit_prog | ||
| 45 | - #define create_key PyThread_create_key | ||
| 46 | - #define delete_key PyThread_delete_key | ||
| 47 | - #define get_key_value PyThread_get_key_value | ||
| 48 | - #define set_key_value PyThread_set_key_value | ||
| 49 | - | ||
| 50 | - | ||
| 51 | - DL_IMPORT(void) init_thread Py_PROTO((void)); | ||
| 52 | - DL_IMPORT(int) start_new_thread Py_PROTO((void (*)(void *), void *)); | ||
| 53 | - #ifndef __BEOS__ | ||
| 54 | - DL_IMPORT(void) exit_thread Py_PROTO((void)); | ||
| 55 | - DL_IMPORT(void) _exit_thread Py_PROTO((void)); | ||
| 56 | - #else | ||
| 22 | + DL_IMPORT(void) PyThread_init_thread Py_PROTO((void)); | ||
| 23 | + DL_IMPORT(int) PyThread_start_new_thread Py_PROTO((void (*)(void *), void *)); | ||
| 57 | 24 | DL_IMPORT(void) PyThread_exit_thread Py_PROTO((void)); | |
| 58 | - DL_IMPORT(void) PyThread__exit_thread Py_PROTO((void)); | ||
| 59 | - #endif | ||
| 60 | - DL_IMPORT(long) get_thread_ident Py_PROTO((void)); | ||
| 25 | + DL_IMPORT(void) PyThread__PyThread_exit_thread Py_PROTO((void)); | ||
| 26 | + DL_IMPORT(long) PyThread_get_thread_ident Py_PROTO((void)); | ||
| 61 | 27 | ||
| 62 | - DL_IMPORT(type_lock) allocate_lock Py_PROTO((void)); | ||
| 63 | - DL_IMPORT(void) free_lock Py_PROTO((type_lock)); | ||
| 64 | - DL_IMPORT(int) acquire_lock Py_PROTO((type_lock, int)); | ||
| 28 | + DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock Py_PROTO((void)); | ||
| 29 | + DL_IMPORT(void) PyThread_free_lock Py_PROTO((PyThread_type_lock)); | ||
| 30 | + DL_IMPORT(int) PyThread_acquire_lock Py_PROTO((PyThread_type_lock, int)); | ||
| 65 | 31 | #define WAIT_LOCK 1 | |
| 66 | 32 | #define NOWAIT_LOCK 0 | |
| 67 | - DL_IMPORT(void) release_lock Py_PROTO((type_lock)); | ||
| 33 | + DL_IMPORT(void) PyThread_release_lock Py_PROTO((PyThread_type_lock)); | ||
| 68 | 34 | ||
| 69 | - DL_IMPORT(type_sema) allocate_sema Py_PROTO((int)); | ||
| 70 | - DL_IMPORT(void) free_sema Py_PROTO((type_sema)); | ||
| 71 | - DL_IMPORT(int) down_sema Py_PROTO((type_sema, int)); | ||
| 35 | + DL_IMPORT(PyThread_type_sema) PyThread_allocate_sema Py_PROTO((int)); | ||
| 36 | + DL_IMPORT(void) PyThread_free_sema Py_PROTO((PyThread_type_sema)); | ||
| 37 | + DL_IMPORT(int) PyThread_down_sema Py_PROTO((PyThread_type_sema, int)); | ||
| 72 | 38 | #define WAIT_SEMA 1 | |
| 73 | 39 | #define NOWAIT_SEMA 0 | |
| 74 | - DL_IMPORT(void) up_sema Py_PROTO((type_sema)); | ||
| 40 | + DL_IMPORT(void) PyThread_up_sema Py_PROTO((PyThread_type_sema)); | ||
| 75 | 41 | ||
| 76 | 42 | #ifndef NO_EXIT_PROG | |
| 77 | - DL_IMPORT(void) exit_prog Py_PROTO((int)); | ||
| 78 | - DL_IMPORT(void) _exit_prog Py_PROTO((int)); | ||
| 43 | + DL_IMPORT(void) PyThread_exit_prog Py_PROTO((int)); | ||
| 44 | + DL_IMPORT(void) PyThread__PyThread_exit_prog Py_PROTO((int)); | ||
| 79 | 45 | #endif | |
| 80 | 46 | ||
| 81 | - DL_IMPORT(int) create_key Py_PROTO((void)); | ||
| 82 | - DL_IMPORT(void) delete_key Py_PROTO((int)); | ||
| 83 | - DL_IMPORT(int) set_key_value Py_PROTO((int, void *)); | ||
| 84 | - DL_IMPORT(void *) get_key_value Py_PROTO((int)); | ||
| 47 | + DL_IMPORT(int) PyThread_create_key Py_PROTO((void)); | ||
| 48 | + DL_IMPORT(void) PyThread_delete_key Py_PROTO((int)); | ||
| 49 | + DL_IMPORT(int) PyThread_set_key_value Py_PROTO((int, void *)); | ||
| 50 | + DL_IMPORT(void *) PyThread_get_key_value Py_PROTO((int)); | ||
| 85 | 51 | ||
| 86 | 52 | #ifdef __cplusplus | |
| 87 | 53 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -171,29 +171,29 @@ PERFORMANCE OF THIS SOFTWARE. | |||
| 171 | 171 | ||
| 172 | 172 | */ | |
| 173 | 173 | ||
| 174 | - static type_lock tcl_lock = 0; | ||
| 174 | + static PyThread_type_lock tcl_lock = 0; | ||
| 175 | 175 | static PyThreadState *tcl_tstate = NULL; | |
| 176 | 176 | ||
| 177 | 177 | #define ENTER_TCL \ | |
| 178 | 178 | { PyThreadState *tstate = PyThreadState_Get(); Py_BEGIN_ALLOW_THREADS \ | |
| 179 | - acquire_lock(tcl_lock, 1); tcl_tstate = tstate; | ||
| 179 | + PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; | ||
| 180 | 180 | ||
| 181 | 181 | #define LEAVE_TCL \ | |
| 182 | - tcl_tstate = NULL; release_lock(tcl_lock); Py_END_ALLOW_THREADS} | ||
| 182 | + tcl_tstate = NULL; PyThread_release_lock(tcl_lock); Py_END_ALLOW_THREADS} | ||
| 183 | 183 | ||
| 184 | 184 | #define ENTER_OVERLAP \ | |
| 185 | 185 | Py_END_ALLOW_THREADS | |
| 186 | 186 | ||
| 187 | 187 | #define LEAVE_OVERLAP_TCL \ | |
| 188 | - tcl_tstate = NULL; release_lock(tcl_lock); } | ||
| 188 | + tcl_tstate = NULL; PyThread_release_lock(tcl_lock); } | ||
| 189 | 189 | ||
| 190 | 190 | #define ENTER_PYTHON \ | |
| 191 | 191 | { PyThreadState *tstate = tcl_tstate; tcl_tstate = NULL; \ | |
| 192 | - release_lock(tcl_lock); PyEval_RestoreThread((tstate)); } | ||
| 192 | + PyThread_release_lock(tcl_lock); PyEval_RestoreThread((tstate)); } | ||
| 193 | 193 | ||
| 194 | 194 | #define LEAVE_PYTHON \ | |
| 195 | 195 | { PyThreadState *tstate = PyEval_SaveThread(); \ | |
| 196 | - acquire_lock(tcl_lock, 1); tcl_tstate = tstate; } | ||
| 196 | + PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; } | ||
| 197 | 197 | ||
| 198 | 198 | #else | |
| 199 | 199 | ||
@@ -1679,11 +1679,11 @@ Tkapp_MainLoop(self, args) | |||
| 1679 | 1679 | ||
| 1680 | 1680 | #ifdef WITH_THREAD | |
| 1681 | 1681 | Py_BEGIN_ALLOW_THREADS | |
| 1682 | - acquire_lock(tcl_lock, 1); | ||
| 1682 | + PyThread_acquire_lock(tcl_lock, 1); | ||
| 1683 | 1683 | tcl_tstate = tstate; | |
| 1684 | 1684 | result = Tcl_DoOneEvent(TCL_DONT_WAIT); | |
| 1685 | 1685 | tcl_tstate = NULL; | |
| 1686 | - release_lock(tcl_lock); | ||
| 1686 | + PyThread_release_lock(tcl_lock); | ||
| 1687 | 1687 | if (result == 0) | |
| 1688 | 1688 | Sleep(20); | |
| 1689 | 1689 | Py_END_ALLOW_THREADS | |
@@ -1921,13 +1921,13 @@ EventHook() | |||
| 1921 | 1921 | #endif | |
| 1922 | 1922 | #if defined(WITH_THREAD) || defined(MS_WINDOWS) | |
| 1923 | 1923 | Py_BEGIN_ALLOW_THREADS | |
| 1924 | - acquire_lock(tcl_lock, 1); | ||
| 1924 | + PyThread_acquire_lock(tcl_lock, 1); | ||
| 1925 | 1925 | tcl_tstate = event_tstate; | |
| 1926 | 1926 | ||
| 1927 | 1927 | result = Tcl_DoOneEvent(TCL_DONT_WAIT); | |
| 1928 | 1928 | ||
| 1929 | 1929 | tcl_tstate = NULL; | |
| 1930 | - release_lock(tcl_lock); | ||
| 1930 | + PyThread_release_lock(tcl_lock); | ||
| 1931 | 1931 | if (result == 0) | |
| 1932 | 1932 | Sleep(20); | |
| 1933 | 1933 | Py_END_ALLOW_THREADS | |
@@ -2014,7 +2014,7 @@ init_tkinter() | |||
| 2014 | 2014 | Tkapp_Type.ob_type = &PyType_Type; | |
| 2015 | 2015 | ||
| 2016 | 2016 | #ifdef WITH_THREAD | |
| 2017 | - tcl_lock = allocate_lock(); | ||
| 2017 | + tcl_lock = PyThread_allocate_lock(); | ||
| 2018 | 2018 | #endif | |
| 2019 | 2019 | ||
| 2020 | 2020 | m = Py_InitModule("_tkinter", moduleMethods); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,7 +57,7 @@ typedef struct { | |||
| 57 | 57 | DB *di_bsddb; | |
| 58 | 58 | int di_size; /* -1 means recompute */ | |
| 59 | 59 | #ifdef WITH_THREAD | |
| 60 | - type_lock di_lock; | ||
| 60 | + PyThread_type_lock di_lock; | ||
| 61 | 61 | #endif | |
| 62 | 62 | } bsddbobject; | |
| 63 | 63 | ||
@@ -113,7 +113,7 @@ newdbhashobject(file, flags, mode, | |||
| 113 | 113 | ||
| 114 | 114 | dp->di_size = -1; | |
| 115 | 115 | #ifdef WITH_THREAD | |
| 116 | - dp->di_lock = allocate_lock(); | ||
| 116 | + dp->di_lock = PyThread_allocate_lock(); | ||
| 117 | 117 | if (dp->di_lock == NULL) { | |
| 118 | 118 | PyErr_SetString(BsddbError, "can't allocate lock"); | |
| 119 | 119 | Py_DECREF(dp); | |
@@ -169,7 +169,7 @@ newdbbtobject(file, flags, mode, | |||
| 169 | 169 | ||
| 170 | 170 | dp->di_size = -1; | |
| 171 | 171 | #ifdef WITH_THREAD | |
| 172 | - dp->di_lock = allocate_lock(); | ||
| 172 | + dp->di_lock = PyThread_allocate_lock(); | ||
| 173 | 173 | if (dp->di_lock == NULL) { | |
| 174 | 174 | PyErr_SetString(BsddbError, "can't allocate lock"); | |
| 175 | 175 | Py_DECREF(dp); | |
@@ -225,7 +225,7 @@ newdbrnobject(file, flags, mode, | |||
| 225 | 225 | ||
| 226 | 226 | dp->di_size = -1; | |
| 227 | 227 | #ifdef WITH_THREAD | |
| 228 | - dp->di_lock = allocate_lock(); | ||
| 228 | + dp->di_lock = PyThread_allocate_lock(); | ||
| 229 | 229 | if (dp->di_lock == NULL) { | |
| 230 | 230 | PyErr_SetString(BsddbError, "can't allocate lock"); | |
| 231 | 231 | Py_DECREF(dp); | |
@@ -242,9 +242,9 @@ bsddb_dealloc(dp) | |||
| 242 | 242 | { | |
| 243 | 243 | #ifdef WITH_THREAD | |
| 244 | 244 | if (dp->di_lock) { | |
| 245 | - acquire_lock(dp->di_lock, 0); | ||
| 246 | - release_lock(dp->di_lock); | ||
| 247 | - free_lock(dp->di_lock); | ||
| 245 | + PyThread_acquire_lock(dp->di_lock, 0); | ||
| 246 | + PyThread_release_lock(dp->di_lock); | ||
| 247 | + PyThread_free_lock(dp->di_lock); | ||
| 248 | 248 | dp->di_lock = NULL; | |
| 249 | 249 | } | |
| 250 | 250 | #endif | |
@@ -262,8 +262,8 @@ bsddb_dealloc(dp) | |||
| 262 | 262 | } | |
| 263 | 263 | ||
| 264 | 264 | #ifdef WITH_THREAD | |
| 265 | - #define BSDDB_BGN_SAVE(_dp) Py_BEGIN_ALLOW_THREADS acquire_lock(_dp->di_lock,1); | ||
| 266 | - #define BSDDB_END_SAVE(_dp) release_lock(_dp->di_lock); Py_END_ALLOW_THREADS | ||
| 265 | + #define BSDDB_BGN_SAVE(_dp) Py_BEGIN_ALLOW_THREADS PyThread_acquire_lock(_dp->di_lock,1); | ||
| 266 | + #define BSDDB_END_SAVE(_dp) PyThread_release_lock(_dp->di_lock); Py_END_ALLOW_THREADS | ||
| 267 | 267 | #else | |
| 268 | 268 | #define BSDDB_BGN_SAVE(_dp) Py_BEGIN_ALLOW_THREADS | |
| 269 | 269 | #define BSDDB_END_SAVE(_dp) Py_END_ALLOW_THREADS | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -221,7 +221,7 @@ signal_signal(self, args) | |||
| 221 | 221 | if (!PyArg_Parse(args, "(iO)", &sig_num, &obj)) | |
| 222 | 222 | return NULL; | |
| 223 | 223 | #ifdef WITH_THREAD | |
| 224 | - if (get_thread_ident() != main_thread) { | ||
| 224 | + if (PyThread_get_thread_ident() != main_thread) { | ||
| 225 | 225 | PyErr_SetString(PyExc_ValueError, | |
| 226 | 226 | "signal only works in main thread"); | |
| 227 | 227 | return NULL; | |
@@ -346,7 +346,7 @@ initsignal() | |||
| 346 | 346 | int i; | |
| 347 | 347 | ||
| 348 | 348 | #ifdef WITH_THREAD | |
| 349 | - main_thread = get_thread_ident(); | ||
| 349 | + main_thread = PyThread_get_thread_ident(); | ||
| 350 | 350 | main_pid = getpid(); | |
| 351 | 351 | #endif | |
| 352 | 352 | ||
@@ -619,7 +619,7 @@ PyErr_CheckSignals() | |||
| 619 | 619 | if (!is_tripped) | |
| 620 | 620 | return 0; | |
| 621 | 621 | #ifdef WITH_THREAD | |
| 622 | - if (get_thread_ident() != main_thread) | ||
| 622 | + if (PyThread_get_thread_ident() != main_thread) | ||
| 623 | 623 | return 0; | |
| 624 | 624 | #endif | |
| 625 | 625 | if (!(f = PyEval_GetFrame())) | |
@@ -676,7 +676,7 @@ PyOS_InterruptOccurred() | |||
| 676 | 676 | { | |
| 677 | 677 | if (Handlers[SIGINT].tripped) { | |
| 678 | 678 | #ifdef WITH_THREAD | |
| 679 | - if (get_thread_ident() != main_thread) | ||
| 679 | + if (PyThread_get_thread_ident() != main_thread) | ||
| 680 | 680 | return 0; | |
| 681 | 681 | #endif | |
| 682 | 682 | Handlers[SIGINT].tripped = 0; | |
@@ -689,7 +689,7 @@ void | |||
| 689 | 689 | PyOS_AfterFork() | |
| 690 | 690 | { | |
| 691 | 691 | #ifdef WITH_THREAD | |
| 692 | - main_thread = get_thread_ident(); | ||
| 692 | + main_thread = PyThread_get_thread_ident(); | ||
| 693 | 693 | main_pid = getpid(); | |
| 694 | 694 | #endif | |
| 695 | 695 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -313,7 +313,7 @@ BUILD_FUNC_DEF_4(PySocketSock_New,int,fd, int,family, int,type, int,proto) | |||
| 313 | 313 | /* Lock to allow python interpreter to continue, but only allow one | |
| 314 | 314 | thread to be in gethostbyname */ | |
| 315 | 315 | #if defined(WITH_THREAD) && !defined(HAVE_GETHOSTBYNAME_R) && !defined(MS_WINDOWS) | |
| 316 | - type_lock gethostbyname_lock; | ||
| 316 | + PyThread_type_lock gethostbyname_lock; | ||
| 317 | 317 | #endif | |
| 318 | 318 | ||
| 319 | 319 | ||
@@ -358,11 +358,11 @@ BUILD_FUNC_DEF_2(setipaddr, char*,name, struct sockaddr_in *,addr_ret) | |||
| 358 | 358 | hp = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop); | |
| 359 | 359 | #else /* not HAVE_GETHOSTBYNAME_R */ | |
| 360 | 360 | #if defined(WITH_THREAD) && !defined(MS_WINDOWS) | |
| 361 | - acquire_lock(gethostbyname_lock,1); | ||
| 361 | + PyThread_acquire_lock(gethostbyname_lock,1); | ||
| 362 | 362 | #endif | |
| 363 | 363 | hp = gethostbyname(name); | |
| 364 | 364 | #if defined(WITH_THREAD) && !defined(MS_WINDOWS) | |
| 365 | - release_lock(gethostbyname_lock); | ||
| 365 | + PyThread_release_lock(gethostbyname_lock); | ||
| 366 | 366 | #endif | |
| 367 | 367 | #endif /* HAVE_GETHOSTBYNAME_R */ | |
| 368 | 368 | Py_END_ALLOW_THREADS | |
@@ -1417,11 +1417,11 @@ BUILD_FUNC_DEF_2(PySocket_gethostbyname_ex,PyObject *,self, PyObject *,args) | |||
| 1417 | 1417 | h = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop); | |
| 1418 | 1418 | #else /* not HAVE_GETHOSTBYNAME_R */ | |
| 1419 | 1419 | #if defined(WITH_THREAD) && !defined(MS_WINDOWS) | |
| 1420 | - acquire_lock(gethostbyname_lock,1); | ||
| 1420 | + PyThread_acquire_lock(gethostbyname_lock,1); | ||
| 1421 | 1421 | #endif | |
| 1422 | 1422 | h = gethostbyname(name); | |
| 1423 | 1423 | #if defined(WITH_THREAD) && !defined(MS_WINDOWS) | |
| 1424 | - release_lock(gethostbyname_lock); | ||
| 1424 | + PyThread_release_lock(gethostbyname_lock); | ||
| 1425 | 1425 | #endif | |
| 1426 | 1426 | #endif /* HAVE_GETHOSTBYNAME_R */ | |
| 1427 | 1427 | Py_END_ALLOW_THREADS | |
@@ -1463,13 +1463,13 @@ BUILD_FUNC_DEF_2(PySocket_gethostbyaddr,PyObject *,self, PyObject *, args) | |||
| 1463 | 1463 | &hp_allocated, buf, buf_len, &errnop); | |
| 1464 | 1464 | #else /* not HAVE_GETHOSTBYNAME_R */ | |
| 1465 | 1465 | #if defined(WITH_THREAD) && !defined(MS_WINDOWS) | |
| 1466 | - acquire_lock(gethostbyname_lock,1); | ||
| 1466 | + PyThread_acquire_lock(gethostbyname_lock,1); | ||
| 1467 | 1467 | #endif | |
| 1468 | 1468 | h = gethostbyaddr((char *)&addr.sin_addr, | |
| 1469 | 1469 | sizeof(addr.sin_addr), | |
| 1470 | 1470 | AF_INET); | |
| 1471 | 1471 | #if defined(WITH_THREAD) && !defined(MS_WINDOWS) | |
| 1472 | - release_lock(gethostbyname_lock); | ||
| 1472 | + PyThread_release_lock(gethostbyname_lock); | ||
| 1473 | 1473 | #endif | |
| 1474 | 1474 | #endif /* HAVE_GETHOSTBYNAME_R */ | |
| 1475 | 1475 | Py_END_ALLOW_THREADS | |
@@ -2188,6 +2188,6 @@ initsocket() | |||
| 2188 | 2188 | ||
| 2189 | 2189 | /* Initialize gethostbyname lock */ | |
| 2190 | 2190 | #if defined(WITH_THREAD) && !defined(HAVE_GETHOSTBYNAME_R) && !defined(MS_WINDOWS) | |
| 2191 | - gethostbyname_lock = allocate_lock(); | ||
| 2191 | + gethostbyname_lock = PyThread_allocate_lock(); | ||
| 2192 | 2192 | #endif | |
| 2193 | 2193 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,11 +87,11 @@ PERFORMANCE OF THIS SOFTWARE. | |||
| 87 | 87 | ||
| 88 | 88 | #include "pythread.h" | |
| 89 | 89 | ||
| 90 | - static type_lock StdwinLock; /* Lock held when interpreter not locked */ | ||
| 90 | + static PyThread_type_lock StdwinLock; /* Lock held when interpreter not locked */ | ||
| 91 | 91 | ||
| 92 | - #define BGN_STDWIN Py_BEGIN_ALLOW_THREADS acquire_lock(StdwinLock, 1); | ||
| 93 | - #define RET_STDWIN release_lock(StdwinLock); Py_BLOCK_THREADS | ||
| 94 | - #define END_STDWIN release_lock(StdwinLock); Py_END_ALLOW_THREADS | ||
| 92 | + #define BGN_STDWIN Py_BEGIN_ALLOW_THREADS PyThread_acquire_lock(StdwinLock, 1); | ||
| 93 | + #define RET_STDWIN PyThread_release_lock(StdwinLock); Py_BLOCK_THREADS | ||
| 94 | + #define END_STDWIN PyThread_release_lock(StdwinLock); Py_END_ALLOW_THREADS | ||
| 95 | 95 | ||
| 96 | 96 | #else | |
| 97 | 97 | ||
@@ -2659,6 +2659,6 @@ initstdwin() | |||
| 2659 | 2659 | PyDict_SetItemString(d, "error", StdwinError) != 0) | |
| 2660 | 2660 | return; | |
| 2661 | 2661 | #ifdef WITH_THREAD | |
| 2662 | - StdwinLock = allocate_lock(); | ||
| 2662 | + StdwinLock = PyThread_allocate_lock(); | ||
| 2663 | 2663 | #endif | |
| 2664 | 2664 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments