Boost logo

Threads-Devel :

Subject: [Threads-devel] reverse_lock exception safety?
From: Fredrik Orderud (forderud_at_[hidden])
Date: 2012-12-21 05:14:52

The implementation of boost::reverse_lock::~reverse_lock calls "lock" on
the mutex retrieved from the provided lock. According to the documentation
[1], "lock" can throw operation_not_permitted,
resource_deadlock_would_occur or device_or_resource_busy exceptions. I
don't see any catching of exceptions inside the destructor, and am
therefore concerned about the exception safety of reverse_lock.

Could someone please explain if reverse_lock is designed to be exception

If not, then I would guess that it could be made exception safe by moving
the destructor implementation into an explicit "close" method, and assert
on it being called in the destructor.

Thanks in advance,
Fredrik Orderud


Threads-Devel list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at