Support more precise resolution timeout.

alarm(2) supports only second resolution timer.
setitimer supports more precise (useconds), so replace it.
This CL fixes some minor timing issues, assuming that
there is no other thread that tries to update signal handler
and the timer.

BUG=chromium:713539
TEST=run timeout_util_unittest.

Change-Id: I18f1339acb7359fd0ef06181a160838ff42e80ed
Reviewed-on: https://chromium-review.googlesource.com/484240
Commit-Ready: Hidehiko Abe <hidehiko@chromium.org>
Tested-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
2 files changed