Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f3a362d

Browse filesBrowse files
committed
pythongh-117657: initialize_new_array
1 parent 35b5eaa commit f3a362d
Copy full SHA for f3a362d

File tree

Expand file treeCollapse file tree

4 files changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+8
-8
lines changed

‎Include/internal/pycore_qsbr.h

Copy file name to clipboardExpand all lines: Include/internal/pycore_qsbr.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ _Py_qsbr_register(struct _PyThreadStateImpl *tstate,
140140

141141
// Disassociates a PyThreadState from the QSBR state and frees the QSBR state.
142142
extern void
143-
_Py_qsbr_unregister(struct _PyThreadStateImpl *tstate);
143+
_Py_qsbr_unregister(PyThreadState *tstate);
144144

145145
extern void
146146
_Py_qsbr_fini(PyInterpreterState *interp);

‎Python/pystate.c

Copy file name to clipboardExpand all lines: Python/pystate.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ tstate_delete_common(PyThreadState *tstate)
17851785
HEAD_UNLOCK(runtime);
17861786

17871787
#ifdef Py_GIL_DISABLED
1788-
_Py_qsbr_unregister((_PyThreadStateImpl *)tstate);
1788+
_Py_qsbr_unregister(tstate);
17891789
#endif
17901790

17911791
// XXX Unbind in PyThreadState_Clear(), or earlier

‎Python/qsbr.c

Copy file name to clipboardExpand all lines: Python/qsbr.c
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,20 +231,21 @@ _Py_qsbr_register(_PyThreadStateImpl *tstate, PyInterpreterState *interp,
231231
}
232232

233233
void
234-
_Py_qsbr_unregister(_PyThreadStateImpl *tstate)
234+
_Py_qsbr_unregister(PyThreadState *tstate)
235235
{
236-
struct _qsbr_shared *shared = tstate->qsbr->shared;
236+
struct _qsbr_shared *shared = &tstate->interp->qsbr;
237+
struct _PyThreadStateImpl *tstate_imp = (_PyThreadStateImpl*) tstate;
237238

238239
PyMutex_Lock(&shared->mutex);
239240
// NOTE: we must load (or reload) the thread state's qbsr inside the mutex
240241
// because the array may have been resized (changing tstate->qsbr) while
241242
// we waited to acquire the mutex.
242-
struct _qsbr_thread_state *qsbr = tstate->qsbr;
243+
struct _qsbr_thread_state *qsbr = tstate_imp->qsbr;
243244

244245
assert(qsbr->seq == 0 && "thread state must be detached");
245-
assert(qsbr->allocated && qsbr->tstate == (PyThreadState *)tstate);
246+
assert(qsbr->allocated && qsbr->tstate == tstate);
246247

247-
tstate->qsbr = NULL;
248+
tstate_imp->qsbr = NULL;
248249
qsbr->tstate = NULL;
249250
qsbr->allocated = false;
250251
qsbr->freelist_next = shared->freelist;

‎Tools/tsan/suppressions_free_threading.txt

Copy file name to clipboardExpand all lines: Tools/tsan/suppressions_free_threading.txt
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ race:_PyParkingLot_Park
2424
race:_PyType_HasFeature
2525
race:assign_version_tag
2626
race:gc_restore_tid
27-
race:initialize_new_array
2827
race:insertdict
2928
race:lookup_tp_dict
3029
race:mi_heap_visit_pages

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.