We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81cf760 commit 400dba8Copy full SHA for 400dba8
tests/extmod/select_poll_eintr.py
@@ -31,9 +31,12 @@ def thread_main():
31
# Could possibly use _thread._interrupt_main() instead if MicroPython had it.
32
gc.collect()
33
print("thread gc end")
34
+ global done
35
+ done = True
36
37
38
# Start a thread to interrupt the main thread during its call to poll.
39
+done = False
40
lock = _thread.allocate_lock()
41
lock.acquire()
42
_thread.start_new_thread(thread_main, ())
@@ -54,5 +57,9 @@ def thread_main():
54
57
else:
55
58
print("dt not in range:", dt_ms)
56
59
60
+# Wait thread done
61
+while not done:
62
+ time.sleep(0.1)
63
+
64
# Clean up.
65
s.close()
0 commit comments