I can't explain it either. It seems to make no sense at all, and I'm
not sure if it is limited to calling from a JNI thread or just a
DLL. I will try to make a complete and simple test case to reproduce
the problem, but in the meantime I made the changes in thread.cpp
and everything seems to be working now. I'm even using condition
variables in my own code. Here's the changes I had to make to get my
code working:
Index: libs/thread/src/thread.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/thread/src/thread.cpp,v
retrieving revision 1.11
diff -u -r1.11 thread.cpp
--- libs/thread/src/thread.cpp 4 Feb 2003 23:22:58 -0000 1.11
+++ libs/thread/src/thread.cpp 11 Mar 2003 16:56:59 -0000
@@ -27,32 +27,22 @@
#include "timeconv.inl"
+#include <memory>
+
namespace {
class thread_param
{
public:
thread_param(const boost::function0<void>& threadfunc)
- : m_threadfunc(threadfunc), m_started(false)
- {
- }
- void wait()
+ : m_threadfunc(threadfunc)
{
- boost::mutex::scoped_lock scoped_lock(m_mutex);
- while (!m_started)
- m_condition.wait(scoped_lock);
}
- void started()
- {
- boost::mutex::scoped_lock scoped_lock(m_mutex);
- m_started = true;
- m_condition.notify_one();
+ boost::function0<void> getfunc() {
+ return m_threadfunc;
}
-
- boost::mutex m_mutex;
- boost::condition m_condition;
- const boost::function0<void>& m_threadfunc;
- bool m_started;
+private:
+ const boost::function0<void> m_threadfunc;
};
} // unnamed namespace
@@ -66,16 +56,12 @@
static OSStatus thread_proxy(void* param)
#endif
{
- try
- {
- thread_param* p = static_cast