Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Date: Mon, 5 Aug 2002 11:58:10 -0400 From: Christopher Faylor To: cygwin-developers AT cygwin DOT com Subject: Re: 1.3.13? Message-ID: <20020805155810.GA5753@redhat.com> Reply-To: cygwin-developers AT cygwin DOT com Mail-Followup-To: cygwin-developers AT cygwin DOT com References: <20020804195150 DOT GA3381 AT redhat DOT com> <124668090713 DOT 20020805140659 AT logos-m DOT ru> <20020805145655 DOT GA4698 AT redhat DOT com> <20020805154128 DOT GA5370 AT redhat DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020805154128.GA5370@redhat.com> User-Agent: Mutt/1.3.23.1i On Mon, Aug 05, 2002 at 11:41:28AM -0400, Christopher Faylor wrote: >On Mon, Aug 05, 2002 at 10:56:55AM -0400, Christopher Faylor wrote: >>On Mon, Aug 05, 2002 at 02:06:59PM +0400, egor duda wrote: >>>Yes. I have a problem with new thread-pool stuff. When runnint cvs >>>session via ssh i get following strace: >> >>Actually, I should have mentioned that I still need to complete the >>cygthread stuff. >> >>If I can duplicate the problem, I'll take a look at it. I should note >>that adding a debug_printf in the ResumeThread loop is apt to slow >>things down *quite* a bit, though. > >I can't duplicate the problem but I have detected a race in my code. > >The below should reduce the window of the race but not eliminate it. >Does it make any difference to the observed behavior? > >cgf > >Index: cygthread.cc >=================================================================== >RCS file: /cvs/uberbaum/winsup/cygwin/cygthread.cc,v >retrieving revision 1.3 >diff -u -p -r1.3 cygthread.cc >--- cygthread.cc 2 Aug 2002 02:10:24 -0000 1.3 >+++ cygthread.cc 5 Aug 2002 15:38:25 -0000 >@@ -7,10 +7,10 @@ Cygwin license. Please consult the file > details. */ > > #include "winsup.h" >+#include > #include "exceptions.h" > #include "security.h" > #include "cygthread.h" >-#include > > #undef CloseHandle > >@@ -45,7 +45,8 @@ cygthread::stub (VOID *arg) > > info->__name = NULL; > SetEvent (info->ev); >- SuspendThread (info->h); >+ SuspendThread (GetCurrentThreadId ()); GetCurrentThread () >+ (void) WaitForSingleObject (info->ev, 0); > } > } > >@@ -86,7 +87,7 @@ void * cygthread::operator > new (size_t) > { > DWORD id; >- cygthread *info; /* Various information needed by the newly created thread */ >+ cygthread *info; > > for (;;) > {