gh-88750: Remove the PYTHONTHREADDEBUG env var support. (#92509)

Remove the `PYTHONTHREADDEBUG` env var support.
Remove no-op dprintf() macro calls.
This commit is contained in:
Gregory P. Smith 2022-05-09 16:03:46 -07:00 committed by GitHub
parent 22bddc864d
commit 6ed7c353b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 5 additions and 107 deletions

View file

@ -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 */