
28 Jul
2010
28 Jul
'10
11:32 p.m.
I was about to make the same comment, however I noticed there is a
thread_safe_ptr::scoped_lock with pointer semantics for such occasions. I think this solution is nice and would happily see it as a part of boost smart pointer or thread libraries.
int pop() { thread_safe_ptr< std::stack<int> >::scoped_lock lock(data_ptr); int my_top = lock->top(); lock->pop(); return my_pop; }
Yes exactly, the current code doesn't support this yet but it was in the pipeline. Philippe