public static bool Wait (object obj, TimeSpan timeout)
{
long ms = (long) timeout.TotalMilliseconds;
if (ms < Timeout.Infinite || ms > Int32.MaxValue)
throw new ArgumentOutOfRangeException ("timeout", "timeout out of range");
return Wait (obj, (int) ms);
}