aboutsummaryrefslogtreecommitdiff
path: root/bsd-user/main.c
diff options
context:
space:
mode:
authorWarner Losh <imp@bsdimp.com>2021-09-19 01:11:43 -0600
committerWarner Losh <imp@bsdimp.com>2021-10-18 12:51:39 -0600
commit653ccec26dd3f9942ac258c43be0edb93e16dfba (patch)
treec0f27c4d94847f7b2257316f8cbb3c41fa03cdec /bsd-user/main.c
parent7aac7392346d1f5bb9fc31cb7e4f3f1f3fc2be05 (diff)
downloadqemu-653ccec26dd3f9942ac258c43be0edb93e16dfba.zip
qemu-653ccec26dd3f9942ac258c43be0edb93e16dfba.tar.gz
qemu-653ccec26dd3f9942ac258c43be0edb93e16dfba.tar.bz2
bsd-user: Add stop_all_tasks
Similar to the same function in linux-user: this stops all the current tasks. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
Diffstat (limited to 'bsd-user/main.c')
-rw-r--r--bsd-user/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bsd-user/main.c b/bsd-user/main.c
index ee84554..cb5ea40 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -195,6 +195,15 @@ static void usage(void)
__thread CPUState *thread_cpu;
+void stop_all_tasks(void)
+{
+ /*
+ * We trust when using NPTL (pthreads) start_exclusive() handles thread
+ * stopping correctly.
+ */
+ start_exclusive();
+}
+
bool qemu_cpu_is_self(CPUState *cpu)
{
return thread_cpu == cpu;