Skip to content

Conversation

@kumaraditya303
Copy link
Contributor

@kumaraditya303kumaraditya303 commented Jan 25, 2025

returneg;
PyObject*stack[] ={self->msg, excs};
size_tnargsf=2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
returnPyObject_Vectorcall(PyExc_BaseExceptionGroup, stack, nargsf, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it thread safe?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was an unrelated optimization merged accidently into this, removed now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What here makes it thread safe then?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What here makes it thread safe then?

Adding @critical_section using argument clinic makes it use critical section around function call which makes it thread safe.

@kumaraditya303kumaraditya303 merged commit 3f2cfd0 into python:mainJan 25, 2025
44 checks passed
@kumaraditya303kumaraditya303 deleted the exceptions branch January 26, 2025 06:55
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kumaraditya303@iritkatriel