2014-05-04 1:13 GMT+04:00 Niall Douglas
Dear Boost,
Review and commentary upon a proposed new Boost object, boost::permit<> is invited.
I've just started to read the documentation and that's what looks wrong:
...
And the compiler's optimiser is permitted by the standard to believe that
result has not changed between its initialisation and the first test of its
value, so in fact the optimiser could compile this instead by eliding the
first test of result under the assumption that the predicate will always be
false for its first execution:
do {
wait(guard);} while(!pred());
...
This can not happen because thread constructor is a `release` operation:
// main thread
int result=0;
boost::thread(f); // release [2]
boost::unique_lock