Removed some XNA 3.1 code paths; cleaned up constant usage in platform-specific code sections
git-svn-id: file:///srv/devel/repo-conversion/nusu@211 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
645148a751
commit
46cbc920b1
16 changed files with 75 additions and 110 deletions
|
@ -92,13 +92,8 @@ 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 XNA_3
|
||||
bool signalled = waitHandle.WaitOne(Math.Min(1000, milliseconds), false);
|
||||
#elif XBOX360 || WINDOWS_PHONE
|
||||
bool signalled = waitHandle.WaitOne(Math.Min(1000, milliseconds));
|
||||
#else
|
||||
bool signalled = waitHandle.WaitOne(Math.Min(1000, milliseconds), false);
|
||||
#endif
|
||||
|
||||
// See whether the system date/time have been adjusted while we were asleep.
|
||||
checkForTimeAdjustment();
|
||||
|
||||
|
|
|
@ -128,9 +128,7 @@ namespace Nuclex.Support.Scheduling {
|
|||
|
||||
this.timerThread = new Thread(new ThreadStart(runTimerThread));
|
||||
this.timerThread.Name = "Nuclex.Support.Scheduling.Scheduler";
|
||||
#if XNA_3
|
||||
this.timerThread.Priority = ThreadPriority.Highest;
|
||||
#elif !XBOX360 && !WINDOWS_PHONE
|
||||
#if WINDOWS
|
||||
this.timerThread.Priority = ThreadPriority.Highest;
|
||||
#endif
|
||||
this.timerThread.IsBackground = true;
|
||||
|
@ -147,7 +145,7 @@ namespace Nuclex.Support.Scheduling {
|
|||
// a lot of time given that it doesn't do any real work), forcefully abort
|
||||
// the thread. This may risk some leaks, but it's the only thing we can do.
|
||||
bool success = this.timerThread.Join(2500);
|
||||
#if !XBOX360 && !WINDOWS_PHONE
|
||||
#if WINDOWS
|
||||
Trace.Assert(success, "Scheduler timer thread did not exit in time");
|
||||
#endif
|
||||
// Unsubscribe from the time source to avoid surprise events during or
|
||||
|
|
|
@ -20,7 +20,7 @@ License along with this library
|
|||
|
||||
#if UNITTEST
|
||||
|
||||
#if !XBOX360
|
||||
#if WINDOWS
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -159,6 +159,6 @@ namespace Nuclex.Support.Scheduling {
|
|||
|
||||
} // namespace Nuclex.Support.Scheduling
|
||||
|
||||
#endif // !XBOX360
|
||||
#endif // WINDOWS
|
||||
|
||||
#endif // UNITTEST
|
||||
|
|
|
@ -65,13 +65,7 @@ namespace Nuclex.Support.Scheduling {
|
|||
/// True if the WaitHandle was signalled, false if the timeout was reached
|
||||
/// </returns>
|
||||
public override bool WaitOne(AutoResetEvent waitHandle, long ticks) {
|
||||
#if XNA_3
|
||||
return waitHandle.WaitOne((int)(ticks / TicksPerMillisecond), false);
|
||||
#elif XBOX360 || WINDOWS_PHONE
|
||||
return waitHandle.WaitOne((int)(ticks / TicksPerMillisecond));
|
||||
#else
|
||||
return waitHandle.WaitOne((int)(ticks / TicksPerMillisecond), false);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -86,7 +80,7 @@ namespace Nuclex.Support.Scheduling {
|
|||
/// <summary>Delegate for the timeChanged() callback method</summary>
|
||||
private EventHandler onDateTimeAdjustedDelegate;
|
||||
|
||||
#endif // !XBOX360
|
||||
#endif // !NO_SYSTEMEVENTS
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue