You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support specifying object to lock in Argument Clinic's @critical_section directive #112213
#111903 added support for the @critical_section directive to Argument Clinic. It currently assumes that the first argument is the one that should be locked. This is a good default, but there are at least a few cases where we want to lock a different argument.
For example, in the _weakref module, we generally want to lock the object argument, not the _weakref module itself.
Let's add support for specifying the argument to lock. For example,
/*[clinic input]@critical_section object_weakref.getweakrefs object: object /Return a list of all weak reference objects pointing to 'object'.[clinic start generated code]*/staticPyObject*_weakref_getweakrefs(PyObject*module, PyObject*object)
/*[clinic end generated code: output=25c7731d8e011824 input=00c6d0e5d3206693]*/
Activity
colesbury commentedon Nov 17, 2023
cc @corona10 (motivated by #112189) and @erlend-aasland
pythongh-112213: Support specifying object to lock in AC's @critical_…
gh-112213: Add @critical_section target directive to Argument Clinic (g…
pythongh-112213: Update _weakref module to use new AC feature
Merge branch 'main' into pythongh-112213-weakref
Merge remote-tracking branch 'upstream/main' into pythongh-112213-wea…
gh-112213: Update _weakref module to use new AC feature (gh-112250)
pythongh-112213: Add missing declartion of target_critical_section
gh-112213: Add missing declaration of target_critical_section (gh-112374
pythongh-112213: Add @critical_section target directive to Argument C…
pythongh-112213: Update _weakref module to use new AC feature (python…
pythongh-112213: Add missing declaration of target_critical_section (p…
pythongh-112213: Add @critical_section target directive to Argument C…
pythongh-112213: Update _weakref module to use new AC feature (python…
pythongh-112213: Add missing declaration of target_critical_section (p…