|
smart_ptr<mutex_wrapper<vector<int> >, shared_ptr_policy<ref_link_policy, intrusive_lock_policy> > SharedSmartPointer = new mutex_wrapper<vector<int> >;
if (foofoo) { scope_lock MyLock = SharedSmartPointer; //code using SharedSmartPointer in multithread code }