projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8c29f0
)
Fixed race condition in OfferMessage()
author
Petr Onderka
<gsvick@gmail.com>
Mon, 23 Jul 2012 17:12:44 +0000
(19:12 +0200)
committer
Petr Onderka
<gsvick@gmail.com>
Sun, 19 Aug 2012 22:03:47 +0000
(
00:03
+0200)
mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs
patch
|
blob
|
history
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BroadcastBlockTest.cs
patch
|
blob
|
history
diff --git
a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs
b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs
index 06046cca3326b31ddaac578b4c7e3c5275bd083c..e73c6f1318899023ecc3b00eff45ae9d81b0a95f 100644
(file)
--- a/
mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs
+++ b/
mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs
@@
-82,6
+82,9
@@
namespace System.Threading.Tasks.Dataflow {
postponedMessages [source] = messageHeader;
+ // necessary to avoid race condition
+ DecreaseCount (0);
+
if (!greedy && !full)
EnsureProcessing (true);
diff --git
a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BroadcastBlockTest.cs
b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BroadcastBlockTest.cs
index 98c48e1d88e33eb5dd8d276eaece112000a5a492..1802b389e427a3c6ea695cc6f6323bd373a3e82b 100644
(file)
--- a/
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BroadcastBlockTest.cs
+++ b/
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BroadcastBlockTest.cs
@@
-98,7
+98,7
@@
namespace MonoTests.System.Threading.Tasks.Dataflow {
Assert.IsTrue (broadcast.Post (2));
- Assert.AreEqual (1, target.Receive (TimeSpan.FromMilliseconds (
10
0)));
+ Assert.AreEqual (1, target.Receive (TimeSpan.FromMilliseconds (0)));
Assert.AreEqual (2, target.Receive (TimeSpan.FromMilliseconds (100)));
}