fix Futex when steady_clock and system_clock precisions differ
authorNathan Bronson <ngbronson@fb.com>
Tue, 16 Dec 2014 18:34:47 +0000 (10:34 -0800)
committerJoelMarcey <joelm@fb.com>
Thu, 18 Dec 2014 20:29:40 +0000 (12:29 -0800)
commit1a608d58e87bb9e0c006918293ec9b7e759b11e2
tree5ec718fea43f4e3a29cf74e0989566facd5bb610
parentf2ac9a5cbd5086032a376bd93fcf23ad1af62ee3
fix Futex when steady_clock and system_clock precisions differ

Summary:
To handle the strange relationship between steady_clock and
system_clock (on some platforms these represent only one type, on some
platforms they are separate) Futex::futexWaitUntil converts the deadline
to a duration and back.  On Xcode 6 system_clock is measured in
microseconds and steady_clock in nanoseconds, resulting in a compilation
failure.  This diff fixes it.

Test Plan:
1. compile snippet manually using Xcode
2. new unit test that causes the same implicit conversion failure in a slightly different way

Reviewed By: mssarang@fb.com

Subscribers: trunkagent, folly-diffs@

FB internal diff: D1740903

Tasks: 5831196

Signature: t1:1740903:1418754770:32c999abf1dc87415ffebf45083a903abbded9f2
folly/detail/Futex.h
folly/test/FutexTest.cpp