Re: [Qemu-devel] [PATCH] use a thread id variable

2008-03-17 Thread Glauber Costa
On Sun, Mar 9, 2008 at 11:52 AM, Gilad Ben-Yossef <[EMAIL PROTECTED]> wrote: > Jamie Lokier wrote: > > Gilad Ben-Yossef wrote: > >> Glauber Costa wrote: > >>> This patch introduces a "thread_id" variable to CPUState. > >>> It's duty will be to hold the process, or more generally, thread > >>>

Re: [Qemu-devel] [PATCH] use a thread id variable

2008-03-09 Thread Jamie Lokier
M. Warner Losh wrote: > In message: <[EMAIL PROTECTED]> > Jamie Lokier <[EMAIL PROTECTED]> writes: > : Btw, unfortunately pthread_self() is not safe to call from signal > : handlers. > > And also often times meaningless, as signal handlers can run in > arbitrary threads... That's usua

Re: [kvm-devel] [Qemu-devel] [PATCH] use a thread id variable

2008-03-09 Thread Daniel P. Berrange
On Sun, Mar 09, 2008 at 11:26:43AM +0200, Gilad Ben-Yossef wrote: > Glauber Costa wrote: > > This patch introduces a "thread_id" variable to CPUState. > > It's duty will be to hold the process, or more generally, thread > > id of the current executing cpu > > > > env->nb_watchpoints = 0; > >

Re: [Qemu-devel] [PATCH] use a thread id variable

2008-03-09 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> Gilad Ben-Yossef <[EMAIL PROTECTED]> writes: : > What you're supposed to do with pthreads in general is use pthread_self(). : : Unfortunately, AFAIK the opaque handle that pthread_self() returns is : not quite meaningless outside of the process whereas

Re: [Qemu-devel] [PATCH] use a thread id variable

2008-03-09 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> Jamie Lokier <[EMAIL PROTECTED]> writes: : Btw, unfortunately pthread_self() is not safe to call from signal : handlers. And also often times meaningless, as signal handlers can run in arbitrary threads... Warner

Re: [Qemu-devel] [PATCH] use a thread id variable

2008-03-09 Thread Gilad Ben-Yossef
Jamie Lokier wrote: Gilad Ben-Yossef wrote: Glauber Costa wrote: This patch introduces a "thread_id" variable to CPUState. It's duty will be to hold the process, or more generally, thread id of the current executing cpu env->nb_watchpoints = 0; +#ifdef __WIN32 +env->thread_id = GetCurr

Re: [Qemu-devel] [PATCH] use a thread id variable

2008-03-09 Thread Jamie Lokier
Gilad Ben-Yossef wrote: > Glauber Costa wrote: > >This patch introduces a "thread_id" variable to CPUState. > >It's duty will be to hold the process, or more generally, thread > >id of the current executing cpu > > > > env->nb_watchpoints = 0; > >+#ifdef __WIN32 > >+env->thread_id = GetCurr

Re: [Qemu-devel] [PATCH] use a thread id variable

2008-03-09 Thread Gilad Ben-Yossef
Glauber Costa wrote: This patch introduces a "thread_id" variable to CPUState. It's duty will be to hold the process, or more generally, thread id of the current executing cpu env->nb_watchpoints = 0; +#ifdef __WIN32 +env->thread_id = GetCurrentProcessId(); +#else +env->thread_id =

[Qemu-devel] [PATCH] use a thread id variable

2008-03-05 Thread Glauber Costa
This patch introduces a "thread_id" variable to CPUState. It's duty will be to hold the process, or more generally, thread id of the current executing cpu Signed-off-by: Glauber Costa <[EMAIL PROTECTED]> --- qemu/cpu-defs.h |1 + qemu/exec.c |5 + 2 files changed, 6 insertions(+),