Skip to content

Commit 81c7647

Browse files
brettcannonpull[bot]
authored andcommitted
GH-110455: Guard assert(tstate->thread_id > 0) with #ifndef HAVE_PTHREAD_STUBS (GH-110487)
1 parent f40ffb8 commit 81c7647

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Guard ``assert(tstate->thread_id > 0)`` with ``#ifndef HAVE_PTHREAD_STUBS``.
2+
This allows for for pydebug builds to work under WASI which (currently)
3+
lacks thread support.

Python/pystate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ static void
263263
unbind_tstate(PyThreadState *tstate)
264264
{
265265
assert(tstate != NULL);
266-
// XXX assert(tstate_is_alive(tstate));
267266
assert(tstate_is_bound(tstate));
268-
// XXX assert(!tstate->_status.active);
267+
#ifndef HAVE_PTHREAD_STUBS
269268
assert(tstate->thread_id > 0);
269+
#endif
270270
#ifdef PY_HAVE_THREAD_NATIVE_ID
271271
assert(tstate->native_thread_id > 0);
272272
#endif

0 commit comments

Comments
 (0)