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
#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]*/
Feature or enhancement
#111903 added support for the
@critical_sectiondirective 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
_weakrefmodule, we generally want to lock theobjectargument, not the_weakrefmodule itself.Let's add support for specifying the argument to lock. For example,
Linked PRs