make FB_LOG_EVERY_MS thread safe
authorNathan Bronson <ngbronson@fb.com>
Thu, 27 Feb 2014 17:32:50 +0000 (09:32 -0800)
committerDave Watson <davejwatson@fb.com>
Fri, 28 Feb 2014 22:03:17 +0000 (14:03 -0800)
commit0a52fd7bf776aad7b217f16039a6d12f673c9f69
tree8df669b8f02cbbd8a6eb95498c40e4ba459a4bde
parent3fb62b36b1548dbf7a103fcb9bb972fb6c715967
make FB_LOG_EVERY_MS thread safe

Summary:
Use compare_exchange_strong to update the previous time so that
there is no race.  This diff also adds microbenchmarks.

Test Plan: unit tests

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D1191217
folly/Logging.h
folly/test/LoggingTest.cpp