summaryrefslogtreecommitdiff
path: root/libhw
diff options
context:
space:
mode:
Diffstat (limited to 'libhw')
-rw-r--r--libhw/host_net.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libhw/host_net.c b/libhw/host_net.c
index 917e764..d5a5ad5 100644
--- a/libhw/host_net.c
+++ b/libhw/host_net.c
@@ -1,6 +1,6 @@
/* libhw/host_net.c - <libhw/generic/net.h> implementation for hosted glibc
*
- * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+ * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
@@ -66,9 +66,11 @@ static void hostnet_init(void) {
static inline bool RUN_PTHREAD(void *(*fn)(void *), void *args) {
pthread_t thread;
+ bool saved = cr_save_and_disable_interrupts();
if (pthread_create(&thread, NULL, fn, args))
return true;
cr_pause_and_yield();
+ cr_restore_interrupts(saved);
if (pthread_join(thread, NULL))
return true;
return false;