File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Misc/NEWS.d/next/Core_and_Builtins Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1+ Fixed a race in ``_Py_qsbr_reserve `` in the free threading build.
Original file line number Diff line number Diff line change @@ -205,15 +205,15 @@ _Py_qsbr_reserve(PyInterpreterState *interp)
205205 }
206206 _PyEval_StartTheWorld (interp );
207207 }
208- PyMutex_Unlock (& shared -> mutex );
209-
210- if (qsbr == NULL ) {
211- return -1 ;
212- }
213208
214209 // Return an index rather than the pointer because the array may be
215210 // resized and the pointer invalidated.
216- return (struct _qsbr_pad * )qsbr - shared -> array ;
211+ Py_ssize_t index = -1 ;
212+ if (qsbr != NULL ) {
213+ index = (struct _qsbr_pad * )qsbr - shared -> array ;
214+ }
215+ PyMutex_Unlock (& shared -> mutex );
216+ return index ;
217217}
218218
219219void
You can’t perform that action at this time.
0 commit comments