Opened 14 years ago
Closed 12 years ago
#2161 closed Bugs (wontfix)
Vc90 managed application fails to initialize when using boost/thread
Reported by: | Owned by: | Anthony Williams | |
---|---|---|---|
Milestone: | Boost 1.36.0 | Component: | thread |
Version: | Boost 1.35.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Nicely working application compiled by vc80 stopped working when compiled under vc90. The problem was narrowed down to boost\thread use. To reproduce generate managed "hello world" console app and copy the code below into main. The issue was reported to Mark Levine and Ronald Laerenans at Microsoft but they have not replied...
#include "stdafx.h" #pragma managed(push, off) #include <iostream> #include <boost/thread/condition.hpp> #include <boost/thread/mutex.hpp> #pragma managed(pop)
class Unmanaged { public:
Unmanaged() {
std::cout << FUNCTION << std::endl;
}
~Unmanaged() {
std::cout << FUNCTION << std::endl;
}
void Wait() {
std::cout << FUNCTION << std::endl; boost::mutex::scoped_lock lock(m_mutex); m_condition.wait(lock);
}
private:
boost::condition m_condition; boost::mutex m_mutex;
};
int main(array<System::String^> args) {
System::Console::WriteLine(L"Hello World"); Unmanaged unmgd; unmgd.Wait(); return 0;
}
Boost.Thread does not work with managed C++