summaryrefslogtreecommitdiff
path: root/libhw
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-11 23:33:44 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-11 23:33:44 -0700
commit7eda822ef31a15d22de03fc1eec7d995f661b26d (patch)
tree0f00fdf307cfa78337c50a43e2ff842942922af5 /libhw
parent8573ec62fe175edc73c6c54d24e520ee6aba3f96 (diff)
parentd29cb3f3deda2ae55fbccfdaae3b2481410a0894 (diff)
Merge branch 'lukeshu/9p-tests'
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;