Skip to content

Commit

Permalink
Emit a warning if the half-serializer ignores a value in ForwardOnNext.
Browse files Browse the repository at this point in the history
(cherry picked from commit 7d2d4c4)
  • Loading branch information
danielcweber committed Oct 1, 2018
1 parent 1990de7 commit 1a5abeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Rx.NET/Source/Directory.build.targets
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project>
<!-- This props all need to be set in targets as they depend on the values set earlier -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
<DefineConstants>$(DefineConstants);HAS_WINRT;PREFER_ASYNC;HAS_TPL46;DESKTOPCLR</DefineConstants>
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;DESKTOPCLR</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
<DefineConstants>$(DefineConstants);NO_CODE_COVERAGE_ATTRIBUTE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;NO_SERIALIZABLE;CRIPPLED_REFLECTION;NO_THREAD;WINDOWS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
<DefineConstants>$(DefineConstants);HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;WINDOWS</DefineConstants>
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;WINDOWS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.0'">
<DefineConstants>$(DefineConstants);HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
</PropertyGroup>
</Project>
5 changes: 5 additions & 0 deletions Rx.NET/Source/src/System.Reactive/Internal/HalfSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System.Diagnostics;
using System.Threading;

namespace System.Reactive
Expand Down Expand Up @@ -47,6 +48,10 @@ public static void ForwardOnNext<T>(ISink<T> sink, T item, ref int wip, ref Exce
}
}
}
#if (HAS_TRACE)
else if (error == null)
Trace.TraceWarning("OnNext called while another OnNext call was in progress on the same Observer.");
#endif
}

/// <summary>
Expand Down

0 comments on commit 1a5abeb

Please sign in to comment.