Commit 438b359
committed
Summary
When async_context_threadsafe_background_execute_sync() is invoked from the non‑owner core, the helper worker used to be queued as a async_when_pending_worker_t.
Under heavy IRQ load the “pending” flag could be lost, leaving the semaphore unreleased and the caller blocked indefinitely (issue earlephilhower#2433).
Changes
Replace the helper’s worker field with async_at_time_worker_t and adapt handle_sync_func_call() accordingly.
Queue the helper via async_context_add_at_time_worker_in_ms(..., 0) instead of the previous add_when_pending_worker/set_work_pending pair.
Drop the now‑unnecessary async_context_remove_when_pending_worker() call inside the handler; at‑time workers self‑remove after execution.
.gitignore: ignore .qodo workspace directory.
Impact
The execute‑sync path is now race‑free: the helper worker is guaranteed to run once, release the semaphore, and return the result to the caller, eliminating the sporadic deadlock observed in multicore scenarios.
Co‑authored‑by: Goran Miskovic <schkovich@users.noreply.github.com> Fix contributed for raspberrypi/pico-sdk/issues/24331 parent 9fdfe11 commit 438b359
File tree
1 file changed
+3
-5
lines changed- src/rp2_common/pico_async_context
1 file changed
+3
-5
lines changedLines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| |||
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
148 | | - | |
149 | | - | |
| 147 | + | |
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
| |||
0 commit comments