Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sat, 14 Apr 2001 02:55:11 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com, cygwin-patches AT cygwin DOT com Subject: Re: [PATCH] Re: pthreads update for the adventurous Message-ID: <20010414025511.A9478@redhat.com> Reply-To: cygwin-patches AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com, cygwin-patches AT cygwin DOT com References: <8D00C32549556B4E977F81DBC24E985DC80C AT crtsmail1 DOT technol_exch DOT corp DOT riotinto DOT org> <04e501c0c475$3d059e50$0200a8c0 AT lifelesswks> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: <04e501c0c475$3d059e50$0200a8c0@lifelesswks>; from robert.collins@itdomain.com.au on Sat, Apr 14, 2001 at 09:55:35AM +1000 Go ahead and check this in, Robert. However, please add a blank line after the first ChangeLog entry and pay close attention to the formatting of that first line. One of two formats are acceptable. You've invented a third. Please just use the format that use see elsewhere in the ChangeLog. cgf On Sat, Apr 14, 2001 at 09:55:35AM +1000, Robert Collins wrote: >Thanks for the report David. That bugs been in cygwin's pthread support >forever - but it's gone now. (Cross fingers) > >If you apply the attached patch to your CVS working directory and make a >new cygwin1.dll the test should pass. > >Otherwise, you can wait for the next snapshot. > >Chris: I hope the changelog and patch are ok.. > >== >Saturday Apr 14 2001 Robert Collins > * thread.h (MTinterface): Add threadcount. > * thread.cc (MTinterface::Init): Set threadcount to 1. > (__pthread_create): Increment threadcount. > (__pthread_exit): Decrement threadcount and call exit() from the last >thread. >== > >Rob > >----- Original Message ----- >From: "Billinghurst, David (CRTS)" >To: >Sent: Friday, April 13, 2001 10:55 PM >Subject: RE: pthreads update for the adventurous > > >> OK. I'll bite. >> >> I have built cygwin1.dll from cvs, then proceeded to build and test >gcc-3.0 >> with --enable-threads=posix. This seems to work OK. >> >> I then tried example 1 from >> >http://www.llnl.gov/computing/tutorials/workshops/workshop/pthreads/MAIN >.htm >> l (below) using standard cygwin gcc-2.95.3-2 and the gcc-3.0 I built. >There >> appears to be a problem with pthread_exit() as the program never >exits. I >> tried to debug this, but soon got lost. >> >> >> >> >/*********************************************************************** >**** >> *** >> * FILE: hello.c >> * DESCRIPTION: >> * A "hello world" Pthreads program. Demonstrates thread creation >and >> * termination. >> * >> * SOURCE: >> * LAST REVISED: 9/20/98 Blaise Barney >> >************************************************************************ >**** >> **/ >> >> #include >> #include >> #define NUM_THREADS 5 >> >> void *PrintHello(void *threadid) >> { >> printf("\n%d: Hello World!\n", threadid); >> pthread_exit(NULL); >> } >> >> int main() >> { >> pthread_t threads[NUM_THREADS]; >> int rc, t; >> for(t=0;t> printf("Creating thread %d\n", t); >> rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t); >> if (rc){ >> printf("ERROR; return code from pthread_create() is %d\n", >rc); >> exit(-1); >> } >> } >> pthread_exit(NULL); >> } >> >> >> -- >> Want to unsubscribe from this list? >> Check out: http://cygwin.com/ml/#unsubscribe-simple >> >> >-- >Want to unsubscribe from this list? >Check out: http://cygwin.com/ml/#unsubscribe-simple -- cgf AT cygnus DOT com Red Hat, Inc. http://sources.redhat.com/ http://www.redhat.com/ -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple