aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu/iothread.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2019-03-06 19:55:28 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2019-03-08 10:16:15 +0000
commit21c4d15b4708b7d30c450041a560df670f36cac8 (patch)
tree0a96bef0f39af5f31dc93dd2facd1039ff47c9b8 /include/sysemu/iothread.h
parentbf4069fbd72ae11f6af82f9150d3396c8a95bb18 (diff)
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>
Diffstat (limited to 'include/sysemu/iothread.h')
-rw-r--r--include/sysemu/iothread.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h
index 8a7ac2c528..50411ba54a 100644
--- a/include/sysemu/iothread.h
+++ b/include/sysemu/iothread.h
@@ -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;