Closed kalman5 closed 7 years ago
I will try to do the lock outside a destructor and propagate the exception.
Please could you tell me when do you see the call to terminate?
The problem I have are the exception warranties. What will be the state when there is a failure when trying to lock? The resource will be unusable. What the user should do when receiving an exception?
There are other uses similar to the relocker elsewhere in the library.
You need to mark those DTOR as noexcept(false); if they can throw. Basically even while not being inside a stack unwinding that will make the software terminating.
Ok, I see.
Done in boost 1.65.
relocker DTOR is implemented as the following:
that lock.lock() can throw (see unique_lock::lock in lock_types.hpp) leading to std::terminate if compiled in c++11 mode