We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d56c40 commit d273c8eCopy full SHA for d273c8e
Python/qsbr.c
@@ -205,15 +205,15 @@ _Py_qsbr_reserve(PyInterpreterState *interp)
205
}
206
_PyEval_StartTheWorld(interp);
207
208
- PyMutex_Unlock(&shared->mutex);
209
-
210
- if (qsbr == NULL) {
211
- return -1;
212
- }
213
214
// Return an index rather than the pointer because the array may be
215
// resized and the pointer invalidated.
216
- return (struct _qsbr_pad *)qsbr - shared->array;
+ Py_ssize_t index = -1;
+ if (qsbr != NULL) {
+ index = (struct _qsbr_pad *)qsbr - shared->array;
+ }
+ PyMutex_Unlock(&shared->mutex);
+ return index;
217
218
219
void
0 commit comments