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.

TEST=run timeout_util_unittest.

Change-Id: I18f1339acb7359fd0ef06181a160838ff42e80ed
Commit-Ready: Hidehiko Abe <>
Tested-by: Hidehiko Abe <>
Reviewed-by: Prathmesh Prabhu <>
2 files changed