This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread_create -- no callback?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]