Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5fc0d1b

Browse files
committed
Lock in non-debug builds
1 parent 26b0437 commit 5fc0d1b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Python/instrumentation.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
}
3030
#define ASSERT_WORLD_STOPPED() assert(_PyInterpreterState_GET()->stoptheworld.world_stopped);
3131

32+
#else
33+
34+
#define ASSERT_WORLD_STOPPED_OR_LOCKED(obj)
35+
#define ASSERT_WORLD_STOPPED()
36+
37+
#endif
38+
39+
#ifdef Py_GIL_DISABLED
40+
3241
#define LOCK_CODE(code) \
3342
assert(!_PyInterpreterState_GET()->stoptheworld.world_stopped); \
3443
Py_BEGIN_CRITICAL_SECTION(code)
@@ -37,8 +46,6 @@
3746

3847
#else
3948

40-
#define ASSERT_WORLD_STOPPED_OR_LOCKED(obj)
41-
#define ASSERT_WORLD_STOPPED()
4249
#define LOCK_CODE(code)
4350
#define UNLOCK_CODE()
4451

0 commit comments

Comments
 (0)