Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Closed
Closed
Copy link
Labels
3.13bugs and security fixesbugs and security fixestopic-argument-clinictopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
#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]*/Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixestopic-argument-clinictopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement