diff options
| author | Victor Stinner <vstinner@redhat.com> | 2018-11-30 17:08:02 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-30 17:08:02 (GMT) |
| commit | bc9f53f69e8207027bf2b18e3d01b30401e76ace (patch) | |
| tree | 1c8892446fca4e94e285349b3f6314ace6c29b75 /Python/thread_pthread.h | |
| parent | 8f83c2fb19c45350c2161d9e75dab4cd2bcaee28 (diff) | |
| download | cpython-bc9f53f69e8207027bf2b18e3d01b30401e76ace.zip cpython-bc9f53f69e8207027bf2b18e3d01b30401e76ace.tar.gz cpython-bc9f53f69e8207027bf2b18e3d01b30401e76ace.tar.bz2 | |
bpo-33015: Use malloc() in PyThread_start_new_thread() (GH-10829)
The pthread implementation of PyThread_start_new_thread() now uses
malloc/free rather than PyMem_Malloc/PyMem_Free, since the latters
are not thread-safe.
Diffstat (limited to 'Python/thread_pthread.h')
| -rw-r--r-- | Python/thread_pthread.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index ae6b6b6..6d4b3b3 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -173,7 +173,7 @@ pythread_wrapper(void *arg) pythread_callback *callback = arg; void (*func)(void *) = callback->func; void *func_arg = callback->arg; - PyMem_Free(arg); + free(arg); func(func_arg); return NULL; @@ -213,7 +213,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); #endif - pythread_callback *callback = PyMem_Malloc(sizeof(pythread_callback)); + pythread_callback *callback = malloc(sizeof(pythread_callback)); if (callback == NULL) { return -1; @@ -235,7 +235,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) #endif if (status != 0) { - PyMem_Free(callback); + free(callback); return -1; } |
