Skip to content

gh-117657: Using critical section to make _socket.socket.close thread safe - #120490

Merged
encukou merged 1 commit into
python:mainfrom
aisk:sock-close-race
Jul 1, 2024
Merged

encukou merged 1 commit into
python:mainfrom
aisk:sock-close-race

Conversation

@aisk

@aisk aisk commented Jun 14, 2024 •

Copy link
Copy Markdown
Member

This function has a temporary variable fd which will be fetched and stored from or to _socket.socket.fd, so using critical section to make it thread safe with free-threads build.

@aisk aisk changed the title Using critical section to make _socket.socket.close thread safe Jun 14, 2024
@aisk aisk added the skip news label Jun 14, 2024
@Fidget-Spinner

Copy link
Copy Markdown
Member

Will wait some time for someone else to give a review if they want to.

@encukou encukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks straightforward to me :)

@encukou
encukou merged commit 8a51767 into python:main Jul 1, 2024
@aisk
aisk deleted the sock-close-race branch July 1, 2024 16:56
Akasurde pushed a commit to Akasurde/cpython that referenced this pull request Jul 3, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants