Uh oh!
There was an error while loading. Please reload this page.
gh-120837: Update _Py_DumpExtensionModules to be async-signal-safe - #121051
Conversation
| 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); |
There was a problem hiding this comment.
Do we have to run for loop to prevent CAS failure?
There was a problem hiding this comment.
I think this should be a _Py_atomic_store_uint8(&mutex->_bits, _Py_UNLOCKED)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
corona10
commented
Jun 27, 2024
@colesbury PTAL :) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| 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); |
There was a problem hiding this comment.
I think this should be a _Py_atomic_store_uint8(&mutex->_bits, _Py_UNLOCKED)
Uh oh!
There was an error while loading. Please reload this page.
colesbury
left a comment
There was a problem hiding this comment.
LGTM, thanks for fixing this!
(I left one minor comment inline. Up to you what you want to do with it.)
| #else | ||
| return; |
There was a problem hiding this comment.
The #else return; doesn't do anything. I would delete it, but up to you.
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…afe (pythongh-121051) (cherry picked from commit 1a2e7a7) Co-authored-by: Donghee Na <donghee.na@python.org>
GH-121107 is a backport of this pull request to the 3.13 branch. |
faulthandleritself crashes in free-threading build (in_Py_DumpExtensionModules) #120837