]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
iothread: stash thread ID away
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 27 Feb 2014 10:48:41 +0000 (11:48 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 13 Mar 2014 13:42:24 +0000 (14:42 +0100)
commit88eb7c29e4320597d2f246adf731f0aac97cfbcc
tree2044aec8594d144fe48380f095110abd1bf97199
parent48ff269272f18d2b8fa53cb08365df417588f585
iothread: stash thread ID away

Keep the thread ID around so we can report it via QMP.

There's only one problem: qemu_get_thread_id() (gettid() wrapper on
Linux) must be called from the thread itself.  There is no way to get
the thread ID outside the thread.

This patch uses a condvar to wait for iothread_run() to populate the
thread_id inside the thread.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
iothread.c