Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-01-10 10:50:05


Manuel Jung wrote:
> Hi,
>
> I have a strange problem. The destructor of a class calls join_all().
> But it seems that he hangs there. Even though some other code behind
> the join_all() is executed before it finishs!
> Lets get concret:
>
> seal::~seal()
> {
> ThgPrgs.join_all();
> cout<<"Crabd quits, goodbye"<<endl;
> }
>
> When i run my program, the last message is "Crabd quits, goodbye" and
> it should exit then, but it doesnt. If i stop it running in gdb an do
> a backtrace i get the following:

[...]

You have two calls to ~seal in the call stack. It's quite possible that a
third ~seal has finished and produced the message, after which the second
~seal has deadlocked in join_all for some reason. You could try a
cout<<"~seal: joining all" before the join_all call to see how many times it
will occur.


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