Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the relationship between C++ and the POSIX cleanup handlers?

0
Posted

What is the relationship between C++ and the POSIX cleanup handlers?

0

>Ian Collins wrote: >> >> Stefan Seefeld wrote: >> > >> > Ian Collins wrote: >> > >> > > Cleanup handlers are not a good place to destroy objects, use some >> > > for of container object that to the object and delete it in its >> > > destructor >> > > (a smart pointer) to do this. >> > >> > that would indeed be the right thing, if….if thread cancelation >> > would do proper stack unwinding. >> > >> > Stefan >> >> I would hope it does – the Solaris one does. > >Only if you use Sun’s own compiler and even then – not always. From what I understand, in this compiler, when a thread is canceled, it acts as if some special exception was thrown which is never caught and which does not call unhandled()—in other words, just the unwinding is performed. What is the relationship between this unwinding and the POSIX cleanup handlers? Are these properly interleaved with the unwinding, or are they done first? In other words, what I’m asking is: are the POSIX cleanup handlers somehow hooked into th

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123