mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
iothread: replace init_done_cond with a semaphore
Only sending an init-done message using lock+cond seems an overkill to me. Replacing it with a simpler semaphore. Meanwhile, init the semaphore unconditionally, then we can destroy it unconditionally too in finalize which seems cleaner. Signed-off-by: Peter Xu <peterx@redhat.com> Message-id: 20190306115532.23025-2-peterx@redhat.com Message-Id: <20190306115532.23025-2-peterx@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
bf4069fbd7
commit
21c4d15b47
2 changed files with 5 additions and 15 deletions
|
@ -27,8 +27,7 @@ typedef struct {
|
|||
GMainContext *worker_context;
|
||||
GMainLoop *main_loop;
|
||||
GOnce once;
|
||||
QemuMutex init_done_lock;
|
||||
QemuCond init_done_cond; /* is thread initialization done? */
|
||||
QemuSemaphore init_done_sem; /* is thread init done? */
|
||||
bool stopping; /* has iothread_stop() been called? */
|
||||
bool running; /* should iothread_run() continue? */
|
||||
int thread_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue