Title
condition_variable_any fails to constrain its Lock parameters
Status
c++23
Section
[thread.condition.condvarany]
Submitter
Casey Carter

Created on 2020-04-04.00:00:00 last changed 4 months ago

Messages

Date: 2020-11-09.21:40:50

Proposed resolution:

This wording is relative to N4861.

  1. Modify [thread.condition.condvarany] as indicated:

    -1- A Lock typeIn this subclause [thread.condition.condvarany], template arguments for template parameters named Lock shall meet the Cpp17BasicLockable requirements ([thread.req.lockable.basic]). [Note: All of the standard mutex types meet this requirement. If a Lock type other than one of the standard mutex types or a unique_lock wrapper for a standard mutex type is used with condition_variable_any, the user should ensure that any necessary synchronization is in place with respect to the predicate associated with the condition_variable_any instance. — end note]

Date: 2020-11-09.00:00:00

[ 2020-11-09 Approved In November virtual meeting. Status changed: Tentatively Ready → WP. ]

Date: 2020-04-11.00:00:00

[ 2020-04-11 Issue Prioritization ]

Status set to Tentatively Ready after seven positive votes on the reflector.

Date: 2020-04-15.00:00:00

[ 2020-04-06; Tim improves wording ]

Date: 2020-04-24.18:46:57

[thread.condition.condvarany]/1 says "A Lock type shall meet the Cpp17BasicLockable requirements ([thread.req.lockable.basic]).", which is fine, but it notably doesn't require anything to be a Lock type or meet the requirements of a Lock type. Given that every member template of condition_variable_any has a template parameter named Lock, the intent is clearly to impose a requirement on the template arguments supplied for those parameters but the use of code font for "Lock" in the definition of "Lock type" is a bit subtle to establish that connection. We should specify this more clearly.

Previous resolution [SUPERSEDED]:

This wording is relative to N4861.

  1. Modify [thread.condition.condvarany] as indicated:

    -1- A Lock typeTemplate arguments for template parameters of member templates of conditional_variable_any named Lock shall meet the Cpp17BasicLockable requirements ([thread.req.lockable.basic]). [Note: All of the standard mutex types meet this requirement. If a Lock type other than one of the standard mutex types or a unique_lock wrapper for a standard mutex type is used with condition_variable_any, the user should ensure that any necessary synchronization is in place with respect to the predicate associated with the condition_variable_any instance. — end note]

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2020-11-09 21:40:50adminsetmessages: + msg11569
2020-11-09 21:40:50adminsetstatus: ready -> wp
2020-04-11 20:10:53adminsetmessages: + msg11212
2020-04-11 20:10:53adminsetstatus: new -> ready
2020-04-06 18:09:50adminsetmessages: + msg11201
2020-04-05 16:56:18adminsetmessages: + msg11200
2020-04-04 00:00:00admincreate