This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.

### 1222. condition_variable incorrect effects for exception safety

Section: 33.7 [thread.condition] Status: C++11 Submitter: Jeffrey Yasskin Opened: 2009-09-30 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [thread.condition].

View all issues with C++11 status.

Discussion:

33.7.4 [thread.condition.condvar] says:

>     void wait(unique_lock<mutex>& lock);

> > ...

> > Effects:

> > - ...
> > - If the function exits via an exception, `lock.unlock()` shall be called prior to exiting the function scope.

Should that be `lock.lock()`?

[ 2009-11-17 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Proposed resolution:

Change 33.7.4 [thread.condition.condvar] p10:

>     void wait(unique_lock<mutex>& lock);

> > ...

> > Effects:

> > - ...
> > - If the function exits via an exception, `lock.unlock()` shall be called prior to exiting the function scope.

And make a similar change in p16, and in 33.7.5 [thread.condition.condvarany], p8 and p13.