Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-04-29 09:48:14


Ross Manges wrote:
> Ahh ha! Thanks for the insight. That has helped me sqash a few
> bugs. Now I do have one last remaining situation, and I have updated
> my example code to use shared_from_this() in a very precarious way.

Your problem is not related to shared_from_this at all:

void SimpleQueue1::add(ElementPtr elem)
{
    queue.push_back(elem);
}

You just forgot to protect queue.push_back by locking the queue mutex.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net