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>
This commit is contained in:
parent
7aac739234
commit
653ccec26d
|
@ -195,6 +195,15 @@ static void usage(void)
|
||||||
|
|
||||||
__thread CPUState *thread_cpu;
|
__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)
|
bool qemu_cpu_is_self(CPUState *cpu)
|
||||||
{
|
{
|
||||||
return thread_cpu == cpu;
|
return thread_cpu == cpu;
|
||||||
|
|
|
@ -103,6 +103,7 @@ typedef struct TaskState {
|
||||||
} __attribute__((aligned(16))) TaskState;
|
} __attribute__((aligned(16))) TaskState;
|
||||||
|
|
||||||
void init_task_state(TaskState *ts);
|
void init_task_state(TaskState *ts);
|
||||||
|
void stop_all_tasks(void);
|
||||||
extern const char *qemu_uname_release;
|
extern const char *qemu_uname_release;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue