summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpthread.h
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2024-12-10 14:50:42 +1100
committerDamien George <damien@micropython.org>2025-02-03 15:02:02 +1100
commit4bcbe88e74de245fdee029b6a0746e3485d82a7e (patch)
tree400657f71958868f75558374efa3146394561dd3 /py/mpthread.h
parent40e1c111e17864044190596dff6d32955d11280c (diff)
downloadmicropython-4bcbe88e74de245fdee029b6a0746e3485d82a7e.tar.gz
micropython-4bcbe88e74de245fdee029b6a0746e3485d82a7e.zip
py: Add optional support for recursive mutexes, use for gc mutex.
Enabled by default if using threading and no GIL This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'py/mpthread.h')
-rw-r--r--py/mpthread.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/mpthread.h b/py/mpthread.h
index f335cc0291..795f230bb4 100644
--- a/py/mpthread.h
+++ b/py/mpthread.h
@@ -48,6 +48,12 @@ void mp_thread_mutex_init(mp_thread_mutex_t *mutex);
int mp_thread_mutex_lock(mp_thread_mutex_t *mutex, int wait);
void mp_thread_mutex_unlock(mp_thread_mutex_t *mutex);
+#if MICROPY_PY_THREAD_RECURSIVE_MUTEX
+void mp_thread_recursive_mutex_init(mp_thread_recursive_mutex_t *mutex);
+int mp_thread_recursive_mutex_lock(mp_thread_recursive_mutex_t *mutex, int wait);
+void mp_thread_recursive_mutex_unlock(mp_thread_recursive_mutex_t *mutex);
+#endif
+
#endif // MICROPY_PY_THREAD
#if MICROPY_PY_THREAD && MICROPY_PY_THREAD_GIL