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 7d24105Copy full SHA for 7d24105
tests/extmod/select_poll_eintr.py
@@ -22,7 +22,6 @@
22
print("SKIP")
23
raise SystemExit
24
25
-
26
def thread_main():
27
lock.acquire()
28
time.sleep(0.2)
@@ -31,9 +30,11 @@ def thread_main():
31
30
# Could possibly use _thread._interrupt_main() instead if MicroPython had it.
32
gc.collect()
33
print("thread gc end")
34
+ global done
+ done = True
35
36
# Start a thread to interrupt the main thread during its call to poll.
37
+done = False
38
lock = _thread.allocate_lock()
39
40
_thread.start_new_thread(thread_main, ())
@@ -54,5 +55,9 @@ def thread_main():
54
55
else:
56
print("dt not in range:", dt_ms)
57
58
+# Wait thread done
59
+while not done:
60
+ time.sleep(0.1)
61
+
62
# Clean up.
63
s.close()
0 commit comments