8000 GH-110829: Ensure Thread.join() joins the OS thread by pitrou · Pull Request #110848 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-110829: Ensure Thread.join() joins the OS thread #110848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Nov 4, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Safe casts on Windows
  • Loading branch information
pitrou committed Nov 4, 2023
commit 5a909ca788fee6e951956a4666279bd24435ecc4
4 changes: 3 additions & 1 deletion Python/thread_nt.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ PyThread_start_joinable_thread(void (*func)(void *), void *arg,
return -1;
}
*ident = threadID;
// The cast is safe since HANDLE is pointer-sized
*handle = (Py_uintptr_t) hThread;
return 0;
}
Expand All @@ -223,7 +224,8 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) {
return PYTHREAD_INVALID_THREAD_ID;
}
CloseHandle((HANDLE) handle);
return ident;
// The cast is safe since the ident is really an unsigned int
return (unsigned long) ident;
}

int
Expand Down
0