
27 Jan
2007
27 Jan
'07
4:21 p.m.
Lars Kunert wrote:
Sorry, I have have shortened the code to some degree - taking the joins out. But the problem really seams to be in the constructor:
QueueError( ST max_queue_size =1000 ) : max_queue__size__( max_queue_size ) , thread_( Worker( this )) {};
You're right, there's a problem in the constructor as well. Specifically,
private: ST max_queue_size_; Queue queue_;
Thread thread_;
boost::mutex monitor_; boost::condition space_available_, job_available_;
thread_ is constructed before monitor_ and can end up trying to lock it before its construction has completed.