File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838
3939struct _mp_state_thread_t ;
4040
41- #if MICROPY_PY_THREAD_GIL
42- #define MP_THREAD_GIL_ENTER () mp_thread_mutex_lock(&MP_STATE_VM(gil_mutex), 1)
43- #define MP_THREAD_GIL_EXIT () mp_thread_mutex_unlock(&MP_STATE_VM(gil_mutex))
44- #else
45- #define MP_THREAD_GIL_ENTER ()
46- #define MP_THREAD_GIL_EXIT ()
47- #endif
48-
4941struct _mp_state_thread_t * mp_thread_get_state (void );
5042void mp_thread_set_state (void * state );
5143void mp_thread_create (void * (* entry )(void * ), void * arg , size_t stack_size );
@@ -57,4 +49,12 @@ void mp_thread_mutex_unlock(mp_thread_mutex_t *mutex);
5749
5850#endif // MICROPY_PY_THREAD
5951
52+ #if MICROPY_PY_THREAD && MICROPY_PY_THREAD_GIL
53+ #define MP_THREAD_GIL_ENTER () mp_thread_mutex_lock(&MP_STATE_VM(gil_mutex), 1)
54+ #define MP_THREAD_GIL_EXIT () mp_thread_mutex_unlock(&MP_STATE_VM(gil_mutex))
55+ #else
56+ #define MP_THREAD_GIL_ENTER ()
57+ #define MP_THREAD_GIL_EXIT ()
58+ #endif
59+
6060#endif // __MICROPY_INCLUDED_PY_MPTHREAD_H__
You can’t perform that action at this time.
0 commit comments