delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/14/16:24:17

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
Message-ID: <20011114212317.56701.qmail@web21002.mail.yahoo.com>
Date: Wed, 14 Nov 2001 13:23:17 -0800 (PST)
From: Evan Pollan <evan_pollan AT yahoo DOT com>
Subject: Re: pthread_create -- no callback?
To: Robert Collins <robert DOT collins AT itdomain DOT com DOT au>,
"Lassi A. Tuura" <lassi DOT tuura AT cern DOT ch>
Cc: cygwin AT cygwin DOT com
In-Reply-To: <024401c16d49$0f7f0f70$0200a8c0@lifelesswks>
MIME-Version: 1.0

> > On linux it returns ESRCH = no such thread.  Your problem is with the
> > thread argument to pthread_join as shown below.
> >
> > Since you are not joining with the thread, the output might disappear...

I'd missed your point earlier!!!  I was calling pthread_join with the address
of the thread rather than the thread itself...

That's all I needed.  My experience is very stale w/ C & C++, but why didn't I
get at least a compilation warning when I passed the reference to the thread,
rather than its value?

I.e.
    pthread_t thread;
     <snip>
    retVal = pthread_join(thread, &threadExitStatus);

*AND*

    pthread_t thread;
     <snip>
    retVal = pthread_join(&thread, &threadExitStatus);

both compile with no warnings or errors (using g++ -W -Wall
-Wno-non-virtual-dtor -Wwrite-strings -Wpointer-arith -Wnested-externs
-Woverloaded-virtual -Wbad-function-cast -ansi -pedantic).


Evan

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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