micropython/tests/thread
Angus Gratton 5d8878b582 shared/tinyusb: Only run TinyUSB on the main thread if GIL is disabled.
If GIL is disabled then there's threat of a race condition if some other
code specifically requests USB processing (i.e. to unblock stdio), while
a scheduled TinyUSB callback is already running on another thread.

Relies on the change in the parent commit, where scheduler is restricted
to main thread if GIL is disabled.

Fixes #15390 - "TinyUSB callback can't recurse" exceptions on rp2 when
using _thread module and USB serial I/O.

Adds a unit test for stdin functioning correctly in threads (fails on rp2
port without this fix).

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-19 13:17:01 +10:00
..
disable_irq.py
disable_irq.py.exp
mutate_bytearray.py
mutate_dict.py
mutate_instance.py
mutate_list.py
mutate_set.py
stress_aes.py
stress_create.py
stress_heap.py
stress_recurse.py
stress_schedule.py
stress_schedule.py.exp
thread_coop.py
thread_coop.py.exp
thread_exc1.py
thread_exc2.py
thread_exc2.py.exp
thread_exit1.py
thread_exit2.py
thread_gc1.py
thread_heap_lock.py
thread_heap_lock.py.exp
thread_ident1.py
thread_lock1.py
thread_lock2.py
thread_lock3.py
thread_lock4.py
thread_lock5.py
thread_qstr1.py
thread_shared1.py
thread_shared2.py
thread_sleep1.py
thread_sleep2.py
thread_stacksize1.py
thread_start1.py
thread_start2.py
thread_stdin.py shared/tinyusb: Only run TinyUSB on the main thread if GIL is disabled. 2024-09-19 13:17:01 +10:00