delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/03/13:47:48

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 3 Jan 2001 13:47:16 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: Re: Error in sem_init (cygwin-1.1.7-1)
Message-ID: <20010103134716.A14686@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
References: <01C075A3 DOT 37A23430 DOT trn AT terma DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <01C075A3.37A23430.trn@terma.com>; from trn@terma.com on Wed, Jan 03, 2001 at 04:37:01PM +0100

I've checked in this change.  Thanks.

cgf

On Wed, Jan 03, 2001 at 04:37:01PM +0100, Torben Nielsen wrote:
>Hi!
>The following code sequence fails (does not wait):
>
>	sem_t sem;
>	sem_init(&sem, 0, 0);
>	sem_wait(&sem);
>
>I believe the reason is found in ./winsup/cygwin/thread.cc line 437 (20001228 snapshot):
>
>	item->win32_obj_id = ::CreateSemaphore (&sec_none_nih, _v, _v, NULL);
>
>The third parameter is the maximum count for the semaphore, and it is not allowed to be zero or less
>according to Microsofts documentation. If I replace this line with
>
>	item->win32_obj_id = ::CreateSemaphore (&sec_none_nih, _v, LONG_MAX, NULL);
>
>the above example works just fine. If possible, I would like a comment on this.
>
>Regards, Torben Nielsen

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019