Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Python/thread_pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
#if defined(THREAD_STACK_SIZE)
size_t tss;
#endif
/* bpo-33015: Use a temporary cast of the function pointer to "void*"
to avoid a compiler warning on the
"void (*func)(void *)" => "void *(*func) (void *)" cast
("void" return type => "void*" return type).

Python uses pthread_detach() and doesn't use pthread_join(),
the thread return value is ignored. */
void *(*start_routine) (void *) = (void *)func;

dprintf(("PyThread_start_new_thread called\n"));
if (!initialized)
Expand Down Expand Up @@ -194,9 +202,8 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
#else
(pthread_attr_t*)NULL,
#endif
(void* (*)(void *))func,
(void *)arg
);
start_routine,
arg);

#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_destroy(&attrs);
Expand Down