summaryrefslogtreecommitdiffstatshomepage
path: root/ports/unix/mpconfigport.h
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix/mpconfigport.h')
-rw-r--r--ports/unix/mpconfigport.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h
index f435c3ff3c..2f01aff0f9 100644
--- a/ports/unix/mpconfigport.h
+++ b/ports/unix/mpconfigport.h
@@ -285,7 +285,12 @@ void mp_unix_mark_exec(void);
#if MICROPY_PY_OS_DUPTERM
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
#else
-#define MP_PLAT_PRINT_STRN(str, len) do { ssize_t ret = write(1, str, len); (void)ret; } while (0)
+#define MP_PLAT_PRINT_STRN(str, len) do { \
+ MP_THREAD_GIL_EXIT(); \
+ ssize_t ret = write(1, str, len); \
+ MP_THREAD_GIL_ENTER(); \
+ (void)ret; \
+} while (0)
#endif
#ifdef __linux__