I already saw a similar question: The destructor against the race of member functions
.. but could not find the answer to the following. Suppose we have a class that owns some workflow. A class destructor might look like this:
~OurClass
{
ask_the_thread_to_terminate;
wait_for_the_thread_to_terminate;
....
do_other_things;
}
The question arises: can we name ourClass member functions in the workflow, because we are sure that all these calls will be made before do_other_things in the destructor?
source
share