Issue 1015: Imprecise wording for cnd_t functions

Authors: Jens Gustedt
Date: 2025-06-17
Reference document: N3559
Submitted against: C23
Status: Open

The wording in C23 7.28 (7.30 in C2y draft N3550) concerning the cnd_t type has several imprecisions.

Use of the verb require

C23 7.28.3.2, 7.28.3.5 and 7.28.3.6 use the verb "require" to formulate a requirement for which it is by itself not clear what the status of a violation of such a requirement would be.

Proposed solution

Change the wording such that it uses "shall" and clearly state that a violation of the requirement results in undefined behavior.

Suggested wording

See n3559.

Use of lock and unlock of a mutex without explicit semantics

C23 7.28.3.5 and 7.28.3.6 and talk about locking and unlocking a mutex mtx without further specifying how these operations interact with other operations on the same mutex.

Proposed solution

Since the cnd_t feature was modeled along the lines of POSIX's pthread_cond_t we propose to take the same solution as is in effect, there. This amounts to say that the lock and unlock operations are performed as if by calls to mtx_lock and mtx_unlock, and then to be a bit more specific on which phases of the condition wait functions synchronize with mtx_t functions and how.

Suggested wording

See n3559.