From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYHo5-00083h-O6 for qemu-devel@nongnu.org; Sun, 09 Mar 2008 05:27:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYHo2-00081Q-RI for qemu-devel@nongnu.org; Sun, 09 Mar 2008 05:27:01 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYHo2-000816-Jf for qemu-devel@nongnu.org; Sun, 09 Mar 2008 05:26:58 -0400 Received: from xenbox.codefidence.com ([92.48.73.16]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JYHo2-00078D-4T for qemu-devel@nongnu.org; Sun, 09 Mar 2008 05:26:58 -0400 Message-ID: <47D3AD53.6030809@codefidence.com> Date: Sun, 09 Mar 2008 11:26:43 +0200 From: Gilad Ben-Yossef MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] use a thread id variable References: <12047472711034-git-send-email-gcosta@redhat.com> <12047472772114-git-send-email-gcosta@redhat.com> In-Reply-To: <12047472772114-git-send-email-gcosta@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel@lists.sourceforge.net, glommer@gmail.com, chrisw@sous-sol.org, Glauber Costa 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 = getpid(); > +#endif > *penv = env; hmm... maybe I'm missing something, but in Linux at least I think you would prefer this to be gettid() rather then getpid as each CPU has it's own thread, not a different process. No? Gilad -- Gilad Ben-Yossef Chief Coffee Drinker Codefidence Ltd. | Web: http://codefidence.com Work: +972-3-7515563 ext. 201 | Mobile: +972-52-8260388 "Your hovercraft is full of eels. For information on emptying your hovercraft, turn to Section 2.6.a.17 of your hovercraft user manual". - The Monty Python technical writer