
Boost lzw
Thanks a lot for the answer. In fact, I am trying to associate data (std::vector<int> and Widget objects) with a boost::mutex by wrapping its interface [ lock(), try_lock() and unlock() ] as follows: class Widget { ... }; // data to be associated with class MyData { public: MyData(std::vector<int>& v) : v_(v), w_(new Widget) { }
~MyData() { m_.~mutex();
Do not call destructors manually. This will lead to undefined behaviour.
delete w_; }
void unlock() { id_ = 0; // reset it, does not compile
id_ = boost::thread::id();
m_.unlock(); }
HTH, Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976