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