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"< ::accept_handler The class seal holds some other classes in shared_ptrs which are will be
destroyed in this moment too. Some of them have also a join_all() in their
destructors. Im wondering if they produce the lock?
But the main question here is:
I read "Crabd quits, goodbye" and after this i stop the program and i get in
the backtrace from gdb the line "#4 0x0808742c in ~seal (this=0x80c9890)
at src/seal.cpp:20". And Line 20 in seal.cpp is the line with join_all().
How is this possible, though join_all should block?
Thanks for your help and for reading this.
Manuel Jung, Germany
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"<
Could you possibly post a small (complete) example that demonstrates the behaviour? I am not able to guess where to problem might be from looking at the destructor only. Btw.: join_all doesn't own the no-throw property. So your design possibly should we reworked anyways. Roland
Roland Schwarz wrote:
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"<
Could you possibly post a small (complete) example that demonstrates the behaviour? I am not able to guess where to problem might be from looking at the destructor only.
Btw.: join_all doesn't own the no-throw property. So your design possibly should we reworked anyways.
Roland
Hi, Thanks for reading. For some reason i post two times the other on has a respond two. The destructor is called two times which should not be right, i will check that tomorow. Im sorry, but i cannot give a small example, thus the program and the code which may be connected with this problem is much too long. join_all dows not throw; But in which way should i change my design? Or do you mean i lack of exception handling? Though i catch errors in my real programcode, thus it throws errors even without it i shortend the code to the minimum. Cheers Manuel Jung
participants (2)
-
Manuel Jung
-
Roland Schwarz