delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/10/10/13:46:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <4169759A.4F3BD401@dessent.net>
Date: Sun, 10 Oct 2004 10:47:06 -0700
From: Brian Dessent <brian AT dessent DOT net>
Organization: My own little world...
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: child thread termination causes main thread error termination
References: <7e48807e0485 DOT 7e04857e4880 AT tampabay DOT rr DOT com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

gmiller AT cfl DOT rr DOT com wrote:
> 
> I have a sample thread application that runs under Ferdora Core 2 latest but exits on an error condition under cygwin.

"lab4_1.c"  Oh boy, there's nothing I like better than fixing someone's
homework assignment.

That aside, what you included doesn't compile:

lab4_1.c:13:32: ../inc/local_mutex.h: No such file or directory
lab4_1.c:49: error: `PTHREAD_COND_INITIALIZER' undeclared here (not in a
function)
lab4_1.c:50: error: `PTHREAD_MUTEX_INITIALIZER' undeclared here (not in
a function)
lab4_1.c:52: error: `PTHREAD_COND_INITIALIZER' undeclared here (not in a
function)
lab4_1.c:53: error: `PTHREAD_MUTEX_INITIALIZER' undeclared here (not in
a function)
lab4_1.c:55: error: `PTHREAD_MUTEX_INITIALIZER' undeclared here (not in
a function)

If you remove the "../inc/local_mutex.h" thing, whatever that is, and
include pthread.h as you should, it compiles and runs fine:

$ ./lab4_1 
waiting do_one_thing
waiting do_another_thing
Ready to start threads ..... 
&Starting ... do_one_thing
+++++Starting ... do_another_thing
---------+++++-----------+++++++++++---------+++++++++++-----------++++++++-----------+++++++++++--------+++++++++++-----------+++++++++++--------+++++++++++-----------++++++++------++++++++@(!(-----@)#^
All threads complete
!)
wrap up: doing another 100, another 100, total 200

Brian

--
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/

- Raw text -


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