Skip to content

Commit d166146

Browse files
committed
Regen files
1 parent ab299f4 commit d166146

File tree

6 files changed

+29
-22
lines changed

6 files changed

+29
-22
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ struct _Py_global_strings {
627627
STRUCT_FOR_ID(offset_src)
628628
STRUCT_FOR_ID(on_type_read)
629629
STRUCT_FOR_ID(onceregistry)
630+
STRUCT_FOR_ID(only_active_thread)
630631
STRUCT_FOR_ID(only_keys)
631632
STRUCT_FOR_ID(oparg)
632633
STRUCT_FOR_ID(opcode)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test_external_inspection.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -888,54 +888,54 @@ def test_only_active_thread(self):
888888
script = textwrap.dedent(
889889
f"""\
890890
import time, sys, socket, threading
891-
891+
892892
# Connect to the test process
893893
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
894894
sock.connect(('localhost', {port}))
895-
895+
896896
def worker_thread(name, barrier, ready_event):
897897
barrier.wait() # Synchronize thread start
898898
ready_event.wait() # Wait for main thread signal
899899
# Sleep to keep thread alive
900900
time.sleep(10_000)
901-
901+
902902
def main_work():
903903
# Do busy work to hold the GIL
904904
count = 0
905905
while count < 100000000:
906906
count += 1
907907
if count % 10000000 == 0:
908908
pass # Keep main thread busy
909-
909+
910910
# Create synchronization primitives
911911
num_threads = 3
912912
barrier = threading.Barrier(num_threads + 1) # +1 for main thread
913913
ready_event = threading.Event()
914-
914+
915915
# Start worker threads
916916
threads = []
917917
for i in range(num_threads):
918918
t = threading.Thread(target=worker_thread, args=(f"Worker-{{i}}", barrier, ready_event))
919919
t.start()
920920
threads.append(t)
921-
921+
922922
# Wait for all threads to be ready
923923
barrier.wait()
924-
924+
925925
# Signal ready to parent process
926926
sock.sendall(b"ready\\n")
927-
927+
928928
# Signal threads to start waiting
929929
ready_event.set()
930-
930+
931931
# Give threads time to start sleeping
932932
time.sleep(0.1)
933-
933+
934934
# Now do busy work to hold the GIL
935935
main_work()
936936
"""
937937
)
938-
938+
939939
with os_helper.temp_dir() as work_dir:
940940
script_dir = os.path.join(work_dir, "script_pkg")
941941
os.mkdir(script_dir)
@@ -953,23 +953,23 @@ def main_work():
953953
p = subprocess.Popen([sys.executable, script_name])
954954
client_socket, _ = server_socket.accept()
955955
server_socket.close()
956-
956+
957957
# Wait for ready signal
958958
response = b""
959959
while b"ready" not in response:
960960
response += client_socket.recv(1024)
961-
961+
962962
# Give threads a moment to start their busy work
963963
time.sleep(0.1)
964-
964+
965965
# Get stack trace with all threads
966966
unwinder_all = RemoteUnwinder(p.pid, all_threads=True)
967967
all_traces = unwinder_all.get_stack_trace()
968-
968+
969969
# Get stack trace with only GIL holder
970970
unwinder_gil = RemoteUnwinder(p.pid, only_active_thread=True)
971971
gil_traces = unwinder_gil.get_stack_trace()
972-
972+
973973
except PermissionError:
974974
self.skipTest(
975975
"Insufficient permissions to read the stack trace"
@@ -980,17 +980,17 @@ def main_work():
980980
p.kill()
981981
p.terminate()
982982
p.wait(timeout=SHORT_TIMEOUT)
983-
983+
984984
# Verify we got multiple threads in all_traces
985985
self.assertGreater(len(all_traces), 1, "Should have multiple threads")
986-
986+
987987
# Verify we got exactly one thread in gil_traces
988988
self.assertEqual(len(gil_traces), 1, "Should have exactly one GIL holder")
989-
989+
990990
# The GIL holder should be in the all_traces list
991991
gil_thread_id = gil_traces[0][0]
992992
all_thread_ids = [trace[0] for trace in all_traces]
993-
self.assertIn(gil_thread_id, all_thread_ids,
993+
self.assertIn(gil_thread_id, all_thread_ids,
994994
"GIL holder should be among all threads")
995995

996996

Modules/_remote_debugging_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,11 +2532,11 @@ _remote_debugging_RemoteUnwinder___init___impl(RemoteUnwinderObject *self,
25322532
{
25332533
// Validate that all_threads and only_active_thread are not both True
25342534
if (all_threads && only_active_thread) {
2535-
PyErr_SetString(PyExc_ValueError,
2535+
PyErr_SetString(PyExc_ValueError,
25362536
"all_threads and only_active_thread cannot both be True");
25372537
return -1;
25382538
}
2539-
2539+
25402540
self->debug = debug;
25412541
self->only_active_thread = only_active_thread;
25422542
self->cached_state = NULL;

0 commit comments

Comments
 (0)