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"<
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.