From c1c74e958f1912a1b2d9aa145f6bf210242d8395 Mon Sep 17 00:00:00 2001 From: Joel Roller Date: Thu, 11 Apr 2019 17:00:54 -0500 Subject: [PATCH] Test Broker Send Many using interlock The test appears to only run a single worker, but the increment count values themselves still may need synchronization with the original test thread. Fixes #896 --- PushSharp.Tests/BrokerTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 PushSharp.Tests/BrokerTests.cs diff --git a/PushSharp.Tests/BrokerTests.cs b/PushSharp.Tests/BrokerTests.cs old mode 100644 new mode 100755 index 92308707..0ab8c70c --- a/PushSharp.Tests/BrokerTests.cs +++ b/PushSharp.Tests/BrokerTests.cs @@ -25,10 +25,10 @@ public void Broker_Send_Many () var broker = new TestServiceBroker (); broker.OnNotificationFailed += (notification, exception) => { - failed++; + Interlocked.Increment(ref failed); }; broker.OnNotificationSucceeded += (notification) => { - succeeded++; + Interlocked.Increment(ref succeeded); }; broker.Start (); broker.ChangeScale (1);