[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pthreads help needed to diagnose #98866



On Mon, May 28, 2001 at 12:23:28AM -0400, Matt Zimmerman wrote:

> WORKS1 and WORKS2 demonstrate two ways I have found to keep the problem from
> happening.  WORKS1 has the thread wait on a semaphore before executing.
> WORKS2 overrides the Thread::Start method with its own version, using exactly
> the same code.  Both of these methods cause the problem to go away.  Where is
> the bug?

Another note (already sent to the bug address): if I change thread.cpp to
create the thread with PTHREAD_CREATE_DETACHED instead of
PTHREAD_CREATE_JOINABLE, and rebuild the shared library, it works.  Of course,
this breaks other functionality in the library, such as the ability to
terminate a thread (uses pthread_join).  Why should there be a difference
between using PTHREAD_CREATE_DETACHED, and calling pthread_detach?

-- 
 - mdz



Reply to: