MB-20079: Ensure updateWaketimeIfLessThan performs a compare_exchange 27/70027/4
authorDaniel Owen <owend@couchbase.com>
Thu, 17 Nov 2016 17:00:25 +0000 (17:00 +0000)
committerDave Rigby <daver@couchbase.com>
Fri, 18 Nov 2016 09:20:40 +0000 (09:20 +0000)
commite9083798f347abf3a4a1a37b2e9ceb730b487545
tree32da1d482804beb037b66c1272ec65e8ddfd5ad2
parentfd43a40de93246dca7cf5de7be197e386729b363
MB-20079: Ensure updateWaketimeIfLessThan performs a compare_exchange

The patch MB-20079: Use std::chrono::steady_clock (ProcessClock) with
changeID: I2fc9688abb782fe2c9e80efb6da840be3643d4a5 introduced a bug
where the waketime could be incorrectly updated, due to not performing
a compare_exchange_strong.

This patch reverts to using a compare_exchange_strong, ensuring that
waketime is only updated if it is less than the input time_point.

Change-Id: Ib68689f9a76c6a0455422c293ad62e9c4d04f3d7
Reviewed-on: http://review.couchbase.org/70027
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/tasks.h