Skip to content

Commit 9792046

Browse files
committed
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 Redth#896
1 parent d36b5f5 commit 9792046

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PushSharp.Tests/BrokerTests.cs

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public void Broker_Send_Many ()
2525

2626
var broker = new TestServiceBroker ();
2727
broker.OnNotificationFailed += (notification, exception) => {
28-
failed++;
28+
Interlocked.Increment(ref failed);
2929
};
3030
broker.OnNotificationSucceeded += (notification) => {
31-
succeeded++;
31+
Interlocked.Increment(ref succeeded);
3232
};
3333
broker.Start ();
3434
broker.ChangeScale (1);

0 commit comments

Comments
 (0)