cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

PL363 32.06.4 [thread.condition.condvarany] wait_until has misleading naming P1869 #360

Closed wg21bot closed 4 years ago

wg21bot commented 4 years ago

The condition_variable_any::wait_until that accepts lock and stop_token, is inconsistent with the [thread.req.timing] p4, that reserves '_until' suffix for functions that accepts time_point. Furthermore, all interruptible waits functions, are accepting stop_token as the last argument, following the predicate, thus making them harder to format in situations when lambda is passed as a predicate.

Proposed change: Change the interruptible waits interface as proposed in P1869R0.

jensmaurer commented 4 years ago

See P1869 Rename 'condition_variable_any' interruptible wait methods cplusplus/papers#619.

ogiroux commented 4 years ago

Actively dislike this name... wait / wait_until / wait_for 0 stoppable_wait / stoppable_wait_until / stoppable_wait_for 6 interruptible_wait / interruptible_wait_until / interruptible_wait_for 10 wait_or_stop / wait_or_stop_until / wait_or_stop_for 8 wait_unless / wait_unless_until / wait_unless_for 12 wait_until / wait_until / wait_for 11 wait_on / wait_on_until / wait_on_for 12

Recommend we rename this overload of wait_until in response to PL 363: template<class Lock, class Predicate> bool wait_until(Lock& lock, Predicate pred, stop_token stoken); ==> template<class Lock, class Predicate> bool wait(Lock& lock, Predicate pred, stop_token stoken); SF F N A SA 1 11 7 2 0 Consensus for change A: making more design changes than I'm sure of at this point

Recommend we change the return type of this overload of wait to void, and don't require re-evaluating the predicate if returning because of stop_token, in response to PL 363: template<class Lock, class Predicate> bool wait(Lock& lock, Predicate pred, stop_token stoken); ==> template<class Lock, class Predicate> void wait(Lock& lock, Predicate pred, stop_token stoken); SF F N A SA 0 7 6 5 0 No consensus for change

Recommend we reorder the arguments of members that take a stop_token according to P1869R0 in response to PL 363: (And also there's a missing comma in the standard for wait_until members!) SF F N A SA 10 8 1 0 0 Unanimous consent

tituswinters commented 4 years ago

LEWG in Belfast: Forward the revision of D1869R1 that includes SG1s newly chosen names to LWG for C++20.

(Prioritization on this vs. other paper-sized NB comments will be shared with LWG chair when LEWG finishes NB comment processing.)

JeffGarland commented 4 years ago

LWG small group Belfast - forward to large group - small paper, wording looks good.

JeffGarland commented 4 years ago

Paper (D1869R1) reviewed by large group on Wed during issues processing. Group approved R1 from LEWG wiki.

jensmaurer commented 4 years ago

Accepted with modification. See paper P1869R1.