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)
205
205
}
206
206
_PyEval_StartTheWorld (interp );
207
207
}
208
- PyMutex_Unlock (& shared -> mutex );
209
-
210
- if (qsbr == NULL ) {
211
- return -1 ;
212
- }
213
208
214
209
// Return an index rather than the pointer because the array may be
215
210
// 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 ;
217
217
}
218
218
219
219
void
You can’t perform that action at this time.
0 commit comments