From eafb9e442bf53dd4dc96c5d6a2930ad052986cac Mon Sep 17 00:00:00 2001 From: Markus Ewald Date: Fri, 24 Dec 2010 01:32:14 +0000 Subject: [PATCH] Fixed compilation error on Windows Phone 7 and Xbox 360 builds git-svn-id: file:///srv/devel/repo-conversion/nusu@212 d2e56fa2-650e-0410-a79f-9358c0239efd --- Source/Scheduling/GenericTimeSource.cs | 5 ++++- Source/Scheduling/WindowsTimeSource.cs | 4 ++++ Source/Tracking/Transaction.cs | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/Scheduling/GenericTimeSource.cs b/Source/Scheduling/GenericTimeSource.cs index cdea585..cc54cfe 100644 --- a/Source/Scheduling/GenericTimeSource.cs +++ b/Source/Scheduling/GenericTimeSource.cs @@ -92,8 +92,11 @@ namespace Nuclex.Support.Scheduling { // Force a timeout at least each second so the caller can check the system time // since we're not able to provide the DateTimeAdjusted notification int milliseconds = (int)(ticks / TicksPerMillisecond); +#if WINDOWS bool signalled = waitHandle.WaitOne(Math.Min(1000, milliseconds), false); - +#else + bool signalled = waitHandle.WaitOne(Math.Min(1000, milliseconds)); +#endif // See whether the system date/time have been adjusted while we were asleep. checkForTimeAdjustment(); diff --git a/Source/Scheduling/WindowsTimeSource.cs b/Source/Scheduling/WindowsTimeSource.cs index f3f01f3..e40b5c1 100644 --- a/Source/Scheduling/WindowsTimeSource.cs +++ b/Source/Scheduling/WindowsTimeSource.cs @@ -65,7 +65,11 @@ namespace Nuclex.Support.Scheduling { /// True if the WaitHandle was signalled, false if the timeout was reached /// public override bool WaitOne(AutoResetEvent waitHandle, long ticks) { +#if WINDOWS return waitHandle.WaitOne((int)(ticks / TicksPerMillisecond), false); +#else + return waitHandle.WaitOne((int)(ticks / TicksPerMillisecond)); +#endif } /// diff --git a/Source/Tracking/Transaction.cs b/Source/Tracking/Transaction.cs index b77c542..2802bc1 100644 --- a/Source/Tracking/Transaction.cs +++ b/Source/Tracking/Transaction.cs @@ -164,7 +164,11 @@ namespace Nuclex.Support.Tracking { return true; } +#if WINDOWS return WaitHandle.WaitOne(timeoutMilliseconds, false); +#else + return WaitHandle.WaitOne(timeoutMilliseconds); +#endif } /// Whether the transaction has ended already