Skip to content

Commit 5854d45

Browse files
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
python-gdb.py now checks for "take_gil" function name to check if a frame tries to acquire the GIL, instead of checking for "pthread_cond_timedwait" which is specific to Linux and can be a different condition than the GIL. (cherry picked from commit 6d0ee60) Co-authored-by: Victor Stinner <[email protected]>
1 parent 3ede1bc commit 5854d45

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Port python-gdb.py to FreeBSD. python-gdb.py now checks for "take_gil"
2+
function name to check if a frame tries to acquire the GIL, instead of
3+
checking for "pthread_cond_timedwait" which is specific to Linux and can be
4+
a different condition than the GIL.

Tools/gdb/libpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ def is_waiting_for_gil(self):
16001600
# This assumes the _POSIX_THREADS version of Python/ceval_gil.h:
16011601
name = self._gdbframe.name()
16021602
if name:
1603-
return 'pthread_cond_timedwait' in name
1603+
return (name == 'take_gil')
16041604

16051605
def is_gc_collect(self):
16061606
'''Is this frame "collect" within the garbage-collector?'''

0 commit comments

Comments
 (0)