From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7Rft-0001WJ-JM for qemu-devel@nongnu.org; Tue, 23 Jun 2015 13:07:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7Rfq-0002nq-E2 for qemu-devel@nongnu.org; Tue, 23 Jun 2015 13:07:53 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=39407 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7Rfq-0002nN-7s for qemu-devel@nongnu.org; Tue, 23 Jun 2015 13:07:50 -0400 Message-ID: <55899261.6020705@weilnetz.de> Date: Tue, 23 Jun 2015 19:07:45 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1435010055-4584-1-git-send-email-zavadovsky.yan@gmail.com> <5588F689.8050202@weilnetz.de> <55893923.9010304@redhat.com> In-Reply-To: <55893923.9010304@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] thread-win32: fix GetThreadContext() permanently fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Peter Maydell , =?UTF-8?B?0K/QvSDQl9Cw0LLQsNC00L7QstGB0LrQuNC5?= , Fabien Chouteau Cc: Olivier Hainque , QEMU Developers Am 23.06.2015 um 12:46 schrieb Paolo Bonzini: > On 23/06/2015 12:30, Peter Maydell wrote: >> On 23 June 2015 at 10:55, =D0=AF=D0=BD =D0=97=D0=B0=D0=B2=D0=B0=D0=B4=D0= =BE=D0=B2=D1=81=D0=BA=D0=B8=D0=B9 wrote: >>> On Tue, Jun 23, 2015 at 9:02 AM, Stefan Weil wrote: >>>> We should add an URL to reliable documentation which supports that >>>> claim. >>> Unfortunately, MSDN says only "SuspendThread suspends the thread. It'= s >>> designed for debuggers. Don't use in applications.": >>> https://msdn.microsoft.com/en-us/library/windows/desktop/ms686345(v=3D= vs.85).aspx >>> And nothing more useful. >>> So when I found this piece of code with Suspend/Resume and failed Get= Context >>> I did some googling. >>> And found this article: >>> http://blogs.msdn.com/b/oldnewthing/archive/2015/02/05/10591215.aspx >> Personally I am happy to treat a Raymond Chen blog post as "reliable >> documentation"... > Me too. :) +1 Fabien, I wonder why nobody noticed that the current code did not do what it was written for. As far as I see the threads were created with the wrong options, so GetThreadContext always failed and therefore was only executed once, so there was no waiting for thread suspension. Removing the code would have given identical results. Is that in an indicator that the SuspendThread is not needed at all, as it was discussed in the other e-mails here? Stefan