Section: 22.214.171.124 [thread.timedmutex.requirements] Status: C++14 Submitter: Pete Becker Opened: 2011-10-18 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [thread.timedmutex.requirements].
View all issues with C++14 status.
126.96.36.199 [thread.timedmutex.requirements]/4 says, in part,
"Requires: If the tick period of [the argument] is not exactly convertible … [it] shall be rounded up …"
This doesn't belong in the requires clause. It's an effect. It belongs in paragraph 5. Nitpickingly, this would be a technical change: as written it imposes an obligation on the caller, while moving it imposes an obligation on the callee. Although that's certainly not what was intended.Peter Dimov comments: Not to mention that it should round down, not up. :-) Incidentally, I see that the wrong try_lock requirement that the caller shall not own the mutex has entered the standard, after all. Oh well. Let's hope that the real world continues to ignore it.
Remove the offending sentence from the requirements clause. Do not add it back anywhere else. The implementation already must have license to wake up late, so the rounding is invisible.Move to Review.
Concurrency move to Ready.
This wording is relative to N3337.
Change 188.8.131.52 [thread.timedmutex.requirements]/4 as indicated:
-3- The expression m.try_lock_for(rel_time) shall be well-formed and have the following semantics:-4- Requires:
If the tick period of rel_time is not exactly convertible to the native tick period, the duration shall be rounded up to the nearest native tick period.If m is of type std::timed_mutex, the calling thread does not own the mutex.