diff options
author | Gregory P. Smith <greg@krypto.org> | 2022-05-09 23:03:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-09 23:03:46 (GMT) |
commit | 6ed7c353b8ded48a9128413f35921ddc4e5b1065 (patch) | |
tree | afc47815078dc4b9eb7bc1ca47b97be3ebabcaac /Python/thread_nt.h | |
parent | 22bddc864d3cc04ed218beb3b706ff1790db836a (diff) | |
download | cpython-6ed7c353b8ded48a9128413f35921ddc4e5b1065.zip cpython-6ed7c353b8ded48a9128413f35921ddc4e5b1065.tar.gz cpython-6ed7c353b8ded48a9128413f35921ddc4e5b1065.tar.bz2 |
gh-88750: Remove the PYTHONTHREADDEBUG env var support. (#92509)
Remove the `PYTHONTHREADDEBUG` env var support.
Remove no-op dprintf() macro calls.
Diffstat (limited to 'Python/thread_nt.h')
-rw-r--r-- | Python/thread_nt.h | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/Python/thread_nt.h b/Python/thread_nt.h index 084bd58..b1defad 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -188,8 +188,6 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) unsigned threadID; callobj *obj; - dprintf(("%lu: PyThread_start_new_thread called\n", - PyThread_get_thread_ident())); if (!initialized) PyThread_init_thread(); @@ -209,14 +207,10 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) * too many threads". */ int e = errno; - dprintf(("%lu: PyThread_start_new_thread failed, errno %d\n", - PyThread_get_thread_ident(), e)); threadID = (unsigned)-1; HeapFree(GetProcessHeap(), 0, obj); } else { - dprintf(("%lu: PyThread_start_new_thread succeeded: %p\n", - PyThread_get_thread_ident(), (void*)hThread)); CloseHandle(hThread); } return threadID; @@ -257,7 +251,6 @@ PyThread_get_thread_native_id(void) void _Py_NO_RETURN PyThread_exit_thread(void) { - dprintf(("%lu: PyThread_exit_thread called\n", PyThread_get_thread_ident())); if (!initialized) exit(0); _endthreadex(0); @@ -273,22 +266,17 @@ PyThread_allocate_lock(void) { PNRMUTEX aLock; - dprintf(("PyThread_allocate_lock called\n")); if (!initialized) PyThread_init_thread(); aLock = AllocNonRecursiveMutex() ; - dprintf(("%lu: PyThread_allocate_lock() -> %p\n", PyThread_get_thread_ident(), aLock)); - return (PyThread_type_lock) aLock; } void PyThread_free_lock(PyThread_type_lock aLock) { - dprintf(("%lu: PyThread_free_lock(%p) called\n", PyThread_get_thread_ident(),aLock)); - FreeNonRecursiveMutex(aLock) ; } @@ -333,9 +321,6 @@ PyThread_acquire_lock_timed(PyThread_type_lock aLock, milliseconds = INFINITE; } - dprintf(("%lu: PyThread_acquire_lock_timed(%p, %lld) called\n", - PyThread_get_thread_ident(), aLock, microseconds)); - if (aLock && EnterNonRecursiveMutex((PNRMUTEX)aLock, (DWORD)milliseconds) == WAIT_OBJECT_0) { success = PY_LOCK_ACQUIRED; @@ -344,9 +329,6 @@ PyThread_acquire_lock_timed(PyThread_type_lock aLock, success = PY_LOCK_FAILURE; } - dprintf(("%lu: PyThread_acquire_lock(%p, %lld) -> %d\n", - PyThread_get_thread_ident(), aLock, microseconds, success)); - return success; } int @@ -358,10 +340,9 @@ PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag) void PyThread_release_lock(PyThread_type_lock aLock) { - dprintf(("%lu: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock)); - - if (!(aLock && LeaveNonRecursiveMutex((PNRMUTEX) aLock))) - dprintf(("%lu: Could not PyThread_release_lock(%p) error: %ld\n", PyThread_get_thread_ident(), aLock, GetLastError())); + if (aLock) { + (void)LeaveNonRecursiveMutex((PNRMUTEX) aLock); + } } /* minimum/maximum thread stack sizes supported */ |