diff options
Diffstat (limited to 'external/rx/Rx/NET/Source/System.Reactive.PlatformServices')
7 files changed, 73 insertions, 17 deletions
diff --git a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Properties/AssemblyInfo.cs b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Properties/AssemblyInfo.cs index 4d3ccea18b..2e97541285 100644 --- a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Properties/AssemblyInfo.cs +++ b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Properties/AssemblyInfo.cs @@ -27,11 +27,11 @@ using System.Security; [assembly: AllowPartiallyTrustedCallers] #endif -#if XBOX_LAKEVIEW -[assembly: SecurityTransparent] -#endif +// =========================================================================== +// DO NOT EDIT OR REMOVE ANYTHING BELOW THIS COMMENT. +// Version numbers are automatically generated in the msbuild files based on regular expressions +// =========================================================================== -// -// Note: Assembly (file) version numbers get inserted by the build system on the fly. Inspect the Team Build workflows -// and the custom activity in Build/Source/Activities/AppendVersionInfo.cs for more information. -// +[assembly: AssemblyVersion("2.2.0.0")] +[assembly: AssemblyFileVersion("2.2.0.0")] +[assembly: AssemblyInformationalVersion("2.2.0.0")] diff --git a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs index 4c91463d15..7cb011bc1e 100644 --- a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs +++ b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs @@ -22,16 +22,21 @@ namespace System.Reactive.Concurrency public IDisposable StartPeriodicTimer(Action action, TimeSpan period) { - // - // MSDN documentation states the following: - // - // "If period is zero (0) or negative one (-1) milliseconds and dueTime is positive, callback is invoked once; - // the periodic behavior of the timer is disabled, but can be re-enabled using the Change method." - // - if (period <= TimeSpan.Zero) + if (period < TimeSpan.Zero) throw new ArgumentOutOfRangeException("period"); - return new PeriodicTimer(action, period); + // + // The contract for periodic scheduling in Rx is that specifying TimeSpan.Zero as the period causes the scheduler to + // call back periodically as fast as possible, sequentially. + // + if (period == TimeSpan.Zero) + { + return new FastPeriodicTimer(action); + } + else + { + return new PeriodicTimer(action, period); + } } public IDisposable QueueUserWorkItem(Action<object> action, object state) @@ -366,6 +371,37 @@ namespace System.Reactive.Concurrency } } #endif + + class FastPeriodicTimer : IDisposable + { + private readonly Action _action; + private bool disposed; + + public FastPeriodicTimer(Action action) + { + _action = action; + + new System.Threading.Thread(Loop) + { + Name = "Rx-FastPeriodicTimer", + IsBackground = true + } + .Start(); + } + + private void Loop() + { + while (!disposed) + { + _action(); + } + } + + public void Dispose() + { + disposed = true; + } + } } } #endif
\ No newline at end of file diff --git a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/EventLoopScheduler.cs b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/EventLoopScheduler.cs index 8739895a8b..98df416683 100644 --- a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/EventLoopScheduler.cs +++ b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/EventLoopScheduler.cs @@ -296,6 +296,16 @@ namespace System.Reactive.Concurrency lock (_gate) { // + // Bug fix that ensures the number of calls to Release never greatly exceeds the number of calls to Wait. + // See work item #37: https://rx.codeplex.com/workitem/37 + // +#if !NO_CDS + while (_evt.CurrentCount > 0) _evt.Wait(); +#else + while (_evt.WaitOne(TimeSpan.Zero)) { } +#endif + + // // The event could have been set by a call to Dispose. This takes priority over anything else. We quit the // loop immediately. Subsequent calls to Schedule won't ever create a new thread. // diff --git a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/TaskPoolScheduler.cs b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/TaskPoolScheduler.cs index a84588bc36..a27e7a6e36 100644 --- a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/TaskPoolScheduler.cs +++ b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Concurrency/TaskPoolScheduler.cs @@ -111,7 +111,11 @@ namespace System.Reactive.Concurrency var ct = new CancellationDisposable(); d.Disposable = ct; +#if USE_TASKEX + TaskEx.Delay(dueTime, ct.Token).ContinueWith(_ => +#else Task.Delay(dueTime, ct.Token).ContinueWith(_ => +#endif { if (!d.IsDisposed) d.Disposable = action(this, state); @@ -190,7 +194,11 @@ namespace System.Reactive.Concurrency var moveNext = default(Action); moveNext = () => { +#if USE_TASKEX + TaskEx.Delay(period, cancel.Token).ContinueWith( +#else Task.Delay(period, cancel.Token).ContinueWith( +#endif _ => { moveNext(); diff --git a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Internal/PlatformEnlightenmentProvider.cs b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Internal/PlatformEnlightenmentProvider.cs index 7bb597c446..881178b295 100644 --- a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Internal/PlatformEnlightenmentProvider.cs +++ b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Reactive/Internal/PlatformEnlightenmentProvider.cs @@ -88,7 +88,7 @@ namespace System.Reactive.PlatformServices #if NETCF35 var name = "System.Reactive.Linq.QueryDebugger, System.Reactive.Debugger"; #else -#if CRIPPLED_REFLECTION +#if (CRIPPLED_REFLECTION && HAS_WINRT) var ifType = t.GetTypeInfo(); #else var ifType = t; diff --git a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Strings_PlatformServices.Generated.cs b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Strings_PlatformServices.Generated.cs index b9330afd6a..7ac002dc26 100644 --- a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Strings_PlatformServices.Generated.cs +++ b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/Strings_PlatformServices.Generated.cs @@ -53,7 +53,7 @@ namespace System.Reactive { if (object.ReferenceEquals(resourceMan, null)) { -#if CRIPPLED_REFLECTION +#if (CRIPPLED_REFLECTION && HAS_WINRT) global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_PlatformServices", typeof(Strings_PlatformServices).GetTypeInfo().Assembly); #else global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_PlatformServices", typeof(Strings_PlatformServices).Assembly); diff --git a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/System.Reactive.PlatformServices.csproj b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/System.Reactive.PlatformServices.csproj index e40f2ab72a..10f8aa208b 100644 --- a/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/System.Reactive.PlatformServices.csproj +++ b/external/rx/Rx/NET/Source/System.Reactive.PlatformServices/System.Reactive.PlatformServices.csproj @@ -12,6 +12,7 @@ <FileAlignment>512</FileAlignment> <ProductSignAssembly>true</ProductSignAssembly> <CodeAnalysisRuleSet>..\Rx.ruleset</CodeAnalysisRuleSet> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseXBLV|AnyCPU'"> <OutputPath>bin\ReleaseXBLV\</OutputPath> @@ -72,4 +73,5 @@ </EmbeddedResource> </ItemGroup> <Import Project="..\Import.targets" /> + <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> </Project>
\ No newline at end of file |