Change MRES to use DateTime.UtcNow instead of Now
authorStephen Toub <stoub@microsoft.com>
Mon, 23 Feb 2015 20:44:23 +0000 (15:44 -0500)
committerStephen Toub <stoub@microsoft.com>
Mon, 23 Feb 2015 20:44:23 +0000 (15:44 -0500)
commit2a5fc06d641d0fdad43b7c42dcadf9cfe8643af9
tree20e6164b794c458cd5e1707ab4d608ea5291e6e8
parent63976a08fbe6ece34a2936ebccdf735ea32044a2
Change MRES to use DateTime.UtcNow instead of Now

In debug builds, ManualResetEventSlim is storing the last time that Set and Reset are called, using DateTime.Now.  This in turn requires time zone information, which is currently not implemented on Unix, causing any usage of ManualResetEventSlim.Set/Reset in a debug build to throw a NotImplementedException.

This change just switches the usage to be DateTime.UtcNow instead of DateTime.Now to avoid the need for time zone information.  I was tempted to remove these debug-only fields entirely, but in case someone's actually using them during debugging, doesn't seem particularly harmful to leave them.
src/mscorlib/src/System/Threading/ManualResetEventSlim.cs