summaryrefslogtreecommitdiff
path: root/tests/thread/disable_irq.py.exp
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2024-06-12 17:19:10 +1000
committerDamien George <damien@micropython.org>2024-06-25 11:01:25 +1000
commitcfa55b4ca1e24dc60dadc839c49fcee475cd40ef (patch)
tree48ff33617a6f7608920c38244725f0b6289301e2 /tests/thread/disable_irq.py.exp
parent908ab1ceca15ee6fd0ef82ca4cba770a3ec41894 (diff)
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>
Diffstat (limited to 'tests/thread/disable_irq.py.exp')
-rw-r--r--tests/thread/disable_irq.py.exp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/thread/disable_irq.py.exp b/tests/thread/disable_irq.py.exp
new file mode 100644
index 000000000..2174b91d0
--- /dev/null
+++ b/tests/thread/disable_irq.py.exp
@@ -0,0 +1,2 @@
+count 2000 True
+PASS