Boost logo

Boost Users :

From: justin_michel (justin_michel_at_[hidden])
Date: 2003-03-10 11:51:30


Platform : Windows XP, Pentium 4, Visual C++ 6 sp5

I've traced down my problem with starting a thread from a DLL called
from Java JNI. If you look at the source code thread.cpp in boost,
you can see that a condition variable is used block the creating
thread until the new thread function is started. Basically, what I
am seeing is that if you wait on this condition variable, then the
thread will never start. If I remove the call to param.wait() at the
bottom of the constructor then everything works fine. I can't think
of a logical explanation, but it's very repeatable. I was also able
to recreate this problem using the latest source from CVS.

The simple solution would be to remove the condition variable from
thread_param code entirely. This would simplify everything, and I
don't really see the value anyway. All that is currently guaranteed
is that thread_proxy will be called before the boost::thread()
constructor is finished. But it doesn't guarantee that threadfunc()
will be called before the constructor is finished.

Thanks,

Justin Michel
OCI


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net