FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe by corona10 · Pull Request #121051 · python/cpython · GitHub

/ cpython Public

gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe - #121051

Merged
corona10 merged 8 commits into
python:mainfrom
corona10:gh-120837
Jun 27, 2024
Merged

gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe#121051
corona10 merged 8 commits into
python:mainfrom
corona10:gh-120837

Conversation

corona10 commented Jun 26, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Comment thread Python/pylifecycle.c Outdated
PyMutex *mutex = &obj->ob_mutex;
uint8_t expected = _Py_UNLOCKED;
// Do not wake up other threads.
_Py_atomic_compare_exchange_uint8(&mutex->_bits, &expected, _Py_UNLOCKED);

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Do we have to run for loop to prevent CAS failure?

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this should be a _Py_atomic_store_uint8(&mutex->_bits, _Py_UNLOCKED)

Comment thread Python/pylifecycle.c Outdated
corona10 requested a review from vstinner June 27, 2024 11:10
Comment thread Python/pylifecycle.c Outdated
corona10 requested a review from vstinner June 27, 2024 11:33

Copy link
Copy Markdown
Member Author

@colesbury PTAL :)

Comment thread Python/pylifecycle.c Outdated
Comment thread Python/pylifecycle.c Outdated
Comment thread Python/pylifecycle.c Outdated
PyMutex *mutex = &obj->ob_mutex;
uint8_t expected = _Py_UNLOCKED;
// Do not wake up other threads.
_Py_atomic_compare_exchange_uint8(&mutex->_bits, &expected, _Py_UNLOCKED);

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this should be a _Py_atomic_store_uint8(&mutex->_bits, _Py_UNLOCKED)

Comment thread Python/pylifecycle.c Outdated
corona10 requested a review from colesbury June 27, 2024 20:53

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, thanks for fixing this!

(I left one minor comment inline. Up to you what you want to do with it.)

Comment thread Python/pylifecycle.c Outdated
Comment on lines +2922 to +2923
#else
return;

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The #else return; doesn't do anything. I would delete it, but up to you.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done!

corona10 merged commit 1a2e7a7 into python:main Jun 27, 2024

Copy link
Copy Markdown

Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 27, 2024
…afe (pythongh-121051)

(cherry picked from commit 1a2e7a7)

Co-authored-by: Donghee Na <donghee.na@python.org>

bedevere-app Bot commented Jun 27, 2024

Copy link
Copy Markdown

GH-121107 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jun 27, 2024
corona10 deleted the gh-120837 branch June 27, 2024 21:47
corona10 added a commit that referenced this pull request Jun 27, 2024
…safe (gh-121051) (gh-121107)

gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe (gh-121051)
(cherry picked from commit 1a2e7a7)

Co-authored-by: Donghee Na <donghee.na@python.org>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL