[PATCH 3/8] get thread id at thread's creation

Glauber Costa
2008-03-04T16:21:56Z

store the thread id through our new call as soon as
the process is created.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
qemu/qemu-kvm.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 8ee3bf8..1aeb97b 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -335,6 +335,7 @@ static void *ap_main_loop(void *_env)

vcpu = &vcpu_info[env->cpu_index];
vcpu->env = env;
+ vcpu->thread_id = kvm_get_thread_id();
sigfillset(&signals);
//sigdelset(&signals, SIG_IPI);
sigprocmask(SIG_BLOCK, &signals, NULL);
@@ -381,6 +382,7 @@ int kvm_init_ap(void)

vcpu = &vcpu_info[0];
vcpu->env = first_cpu;
+ vcpu->thread_id = kvm_get_thread_id();
signal(SIG_IPI, sig_ipi_handler);
for (i = 1; i < smp_cpus; ++i) {
kvm_init_new_ap(i, env);
--
1.5.0.6