circuitpython/tests/thread
Angus Gratton cfa55b4ca1 rp2: Fix recursive atomic sections when core1 is active.
mp_thread_begin_atomic_section() is expected to be recursive (i.e. for
nested machine.disable_irq() calls, or if Python code calls disable_irq()
and then the Python runtime calls mp_handle_pending() which also enters an
atomic section to check the scheduler state).

On rp2 when not using core1 the atomic sections are recursive.

However when core1 was active (i.e. _thread) then there was a bug that
caused the core to live-lock if an atomic section recursed.

Adds a test case specifically for mutual exclusion and recursive atomic
sections when using two threads. Without this fix the test immediately
hangs on rp2.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-06-25 11:01:25 +10:00
..
disable_irq.py rp2: Fix recursive atomic sections when core1 is active. 2024-06-25 11:01:25 +10:00
disable_irq.py.exp rp2: Fix recursive atomic sections when core1 is active. 2024-06-25 11:01:25 +10:00
mutate_bytearray.py top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
mutate_dict.py top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
mutate_instance.py top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
mutate_list.py top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
mutate_set.py top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
stress_aes.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
stress_create.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
stress_heap.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
stress_recurse.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
stress_schedule.py tests/thread: Re-enable GC before stress_schedule test ends. 2024-06-21 14:45:59 +10:00
stress_schedule.py.exp py/scheduler: Add assert that scheduler is locked when unlocking. 2020-04-13 21:55:47 +10:00
thread_exc1.py tests/thread: Make exc1,exit1,exit2,stacksize1,start1 tests run on rp2. 2021-05-10 13:07:16 +10:00
thread_exc2.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_exc2.py.exp tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
thread_exit1.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_exit2.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_gc1.py tests/thread: Adjust thread tests so most are able to run on rp2 port. 2024-01-05 10:02:27 +11:00
thread_heap_lock.py py/gc: Make gc_lock_depth have a count per thread. 2021-05-10 13:07:16 +10:00
thread_heap_lock.py.exp py/gc: Make gc_lock_depth have a count per thread. 2021-05-10 13:07:16 +10:00
thread_ident1.py tests/thread: Adjust thread tests so most are able to run on rp2 port. 2024-01-05 10:02:27 +11:00
thread_lock1.py all: Fix spelling mistakes based on codespell check. 2023-04-27 18:03:06 +10:00
thread_lock2.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_lock3.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
thread_lock4.py tests/thread: Adjust thread tests so most are able to run on rp2 port. 2024-01-05 10:02:27 +11:00
thread_lock5.py esp32/mpthreadport: Use binary semaphore instead of mutex. 2021-05-08 22:47:03 +10:00
thread_qstr1.py tests/thread: Adjust thread tests so most are able to run on rp2 port. 2024-01-05 10:02:27 +11:00
thread_shared1.py tests/thread: Adjust thread tests so most are able to run on rp2 port. 2024-01-05 10:02:27 +11:00
thread_shared2.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
thread_sleep1.py tests/thread: Adjust thread tests so most are able to run on rp2 port. 2024-01-05 10:02:27 +11:00
thread_sleep2.py tests/thread: Add a test for accuracy of sleep within a thread. 2024-01-05 10:35:34 +11:00
thread_stacksize1.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_start1.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
thread_start2.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00