Created on 2011-10-18.00:00:00 last changed 131 months ago
Proposed resolution:
This wording is relative to N3337.
Change [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.
[ 2013-04-20 Bristol ]
[ 2012, Portland ]
Concurrency move to Ready.
[ 2012, Kona ]
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.[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.History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-20 13:20:35 | admin | set | status: wp -> c++14 |
2013-04-25 19:07:07 | admin | set | status: voting -> wp |
2013-04-19 22:22:17 | admin | set | messages: + msg6470 |
2013-04-19 22:22:17 | admin | set | status: ready -> voting |
2012-10-19 07:50:57 | admin | set | messages: + msg6181 |
2012-10-19 07:50:57 | admin | set | status: review -> ready |
2012-02-13 21:55:45 | admin | set | messages: + msg6014 |
2012-02-13 21:55:45 | admin | set | messages: + msg6013 |
2012-02-13 21:55:45 | admin | set | status: new -> review |
2011-10-18 00:00:00 | admin | create |