8000 gh-114271: Make `_thread.ThreadHandle` thread-safe in free-threaded builds by mpage · Pull Request #115190 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-114271: Make _thread.ThreadHandle thread-safe in free-threaded builds #115190

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 21 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
Fix grammar and formatting
  • Loading branch information
mpage committed Feb 9, 2024
commit bcf66cef63dd09abe3876465a16095ab2ee50353
4 changes: 2 additions & 2 deletions Lib/test/test_thread.py
8000
Original file line numberDiff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ def joiner():
# Wait for the joiner to start
joiner_started.acquire()

# Not great, but I don't think there's a deterministic way to do
# make sure that the self-joining thread has been joined.
# Not great, but I don't think there's a deterministic way to make
# sure that the self-joining thread has been joined.
time.sleep(0.1)

# Unblock the self-joiner
Expand Down
2 changes: 0 additions & 2 deletions Modules/_threadmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ new_thread_handle(thread_module_state* state)
PyErr_NoMemory();
return NULL;
}

ThreadHandleObject* self = PyObject_New(ThreadHandleObject, state->thread_handle_type);
if (self == NULL) {
_PyEventRc_Decref(event);
return NULL;
}

self->ident = 0;
self->handle = 0;
self->is_valid = false;
Expand Down
0