bpo-33015: Add a wrapper for thread function in PyThread_start_new_thread by siddhesh · Pull Request #6008 · python/cpython
PyThread_start_new_thread accepts a function of type void (*) (void *), which does not match with the pthread_create function callback prototype void *(*) (void *). This is undefined behaviour and hence results in an invalid function cast warning with gcc8. Fix this by wrapping the function in an internal pthread function callback that returns NULL.
* Rename pythread_fn to pythread_callback * Rename pythread_helper_fn() to pythread_wrapper() * Rewrite the comment
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Fix an undefined behaviour in the pthread implementation of PyThread_start_new_thread(): add a function wrapper to always return NULL. Add pythread_callback struct and pythread_wrapper() to thread_pthread.h. (cherry picked from commit 9eea6ea) Co-authored-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
miss-islington added a commit that referenced this pull request
Fix an undefined behaviour in the pthread implementation of PyThread_start_new_thread(): add a function wrapper to always return NULL. Add pythread_callback struct and pythread_wrapper() to thread_pthread.h. (cherry picked from commit 9eea6ea) Co-authored-by: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
vstinner added a commit that referenced this pull request
vstinner added a commit that referenced this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters