Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-112069: Do not require lock if the set has never been exposed.#118069

Merged
corona10 merged 3 commits into
python:mainpython/cpython:mainfrom
corona10:gh-112069-initcorona10/cpython:gh-112069-initCopy head branch name to clipboard
Apr 25, 2024
Merged

gh-112069: Do not require lock if the set has never been exposed.#118069
corona10 merged 3 commits into
python:mainpython/cpython:mainfrom
corona10:gh-112069-initcorona10/cpython:gh-112069-initCopy head branch name to clipboard

Conversation

@corona10

@corona10 corona10 commented Apr 18, 2024

Copy link
Copy Markdown
Member

@corona10 corona10 requested a review from colesbury April 18, 2024 22:53
@corona10 corona10 requested a review from rhettinger as a code owner April 18, 2024 22:53
@corona10 corona10 added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 18, 2024
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @corona10 for commit 50d62bd 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 18, 2024
Comment thread Objects/setobject.c Outdated
if (!PyArg_UnpackTuple(args, Py_TYPE(self)->tp_name, 0, 1, &iterable))
return -1;

if (self->fill == 0 && Py_REFCNT(self) == 1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should do the Py_REFCNT() check first so that we don't access self->fill without a lock in case there are other threads with references modifying self.

Also, do we need to set self->hash = -1 as we do below?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also, do we need to set self->hash = -1 as we do below?

Well it will be more safe.

@corona10 corona10 requested a review from colesbury April 20, 2024 00:55
@rhettinger rhettinger removed their request for review April 21, 2024 19:11
@corona10

Copy link
Copy Markdown
Member Author

@colesbury gentle ping :)

@colesbury colesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@corona10 corona10 merged commit eb20a7d into python:main Apr 25, 2024
@corona10 corona10 deleted the gh-112069-init branch April 25, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.