Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 1 Oct 2004 13:04:36 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Cygserver 100% CPU (was: References to both cygwin1.dll and msvcrt.dl Message-ID: <20041001110436.GJ26915@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20040930110137 DOT 76042 DOT qmail AT web60306 DOT mail DOT yahoo DOT com> <20041001064108 DOT 14149 DOT qmail AT web60309 DOT mail DOT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041001064108.14149.qmail@web60309.mail.yahoo.com> User-Agent: Mutt/1.4.2i On Sep 30 23:41, Patrick Samson wrote: > Now, when it's wrong, I can see: > good morning (error=4)! > Error 4 is EINTR on the return of msleep(). > Subsequently semop() returns with this EINTR. Are you set up to build cygwin? If so, could you please test the following patch to cygserver and if it changes anything for you? Thanks, Corinna Index: winsup/cygserver/sysv_sem.cc =================================================================== RCS file: /cvs/src/src/winsup/cygserver/sysv_sem.cc,v retrieving revision 1.3 diff -p -u -r1.3 sysv_sem.cc --- winsup/cygserver/sysv_sem.cc 2 Mar 2004 11:08:35 -0000 1.3 +++ winsup/cygserver/sysv_sem.cc 1 Oct 2004 11:02:49 -0000 @@ -1111,15 +1111,6 @@ semop(struct thread *td, struct semop_ar "semwait", 0); DPRINTF(("semop: good morning (error=%d)!\n", error)); - if (error != 0) { -#ifdef __CYGWIN__ - if (error != EIDRM) -#endif /* __CYGWIN__ */ - error = EINTR; - goto done2; - } - DPRINTF(("semop: good morning!\n")); - /* * Make sure that the semaphore still exists */ @@ -1137,6 +1128,20 @@ semop(struct thread *td, struct semop_ar semptr->semzcnt--; else semptr->semncnt--; + + /* + * Is it really morning, or was our sleep interrupted? + * (Delayed check of msleep() return code because we + * need to decrement sem[nz]cnt either way.) + */ + if (error != 0) { +#ifdef __CYGWIN__ + if (error != EIDRM) +#endif /* __CYGWIN__ */ + error = EINTR; + goto done2; + } + DPRINTF(("semop: good morning!\n")); } done: -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/