You've already forked linux-packaging-mono
Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
@ -23,7 +23,7 @@ System.Threading.Tasks.Dataflow/PassingMessageBox.cs
|
||||
System.Threading.Tasks.Dataflow/NameHelper.cs
|
||||
System.Threading.Tasks.Dataflow/TargetCollection.cs
|
||||
System.Threading.Tasks.Dataflow/JoinTarget.cs
|
||||
../corlib/System.Threading/AtomicBoolean.cs
|
||||
../Mono.Parallel/Mono.Threading/AtomicBoolean.cs
|
||||
System.Threading.Tasks.Dataflow/ActionBlock.cs
|
||||
System.Threading.Tasks.Dataflow/BatchBlock.cs
|
||||
System.Threading.Tasks.Dataflow/BatchedJoinBlock.cs
|
||||
|
@ -136,7 +136,7 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
protected override void OutgoingQueueComplete ()
|
||||
{
|
||||
if (MessageQueue.IsCompleted
|
||||
&& Thread.VolatileRead (ref degreeOfParallelism) == 1)
|
||||
&& Volatile.Read (ref degreeOfParallelism) == 1)
|
||||
outgoingQueueComplete ();
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
/// </summary>
|
||||
protected override void VerifyCompleteness ()
|
||||
{
|
||||
if (Thread.VolatileRead (ref degreeOfParallelism) == 1)
|
||||
if (Volatile.Read (ref degreeOfParallelism) == 1)
|
||||
base.VerifyCompleteness ();
|
||||
}
|
||||
|
||||
@ -160,4 +160,4 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
|| iteration < Options.MaxMessagesPerTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
return DataflowMessageStatus.DecliningPermanently;
|
||||
|
||||
var full = options.BoundedCapacity != -1
|
||||
&& Thread.VolatileRead (ref itemCount) >= options.BoundedCapacity;
|
||||
&& Volatile.Read (ref itemCount) >= options.BoundedCapacity;
|
||||
if (!greedy || full) {
|
||||
if (source == null)
|
||||
return DataflowMessageStatus.Declined;
|
||||
@ -252,7 +252,7 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
void RetrievePostponed ()
|
||||
{
|
||||
// BoundedCapacity can't be -1 here, because in that case there would be no postponing
|
||||
while (Thread.VolatileRead (ref itemCount) < options.BoundedCapacity
|
||||
while (Volatile.Read (ref itemCount) < options.BoundedCapacity
|
||||
&& !postponedMessages.IsEmpty && !MessageQueue.IsAddingCompleted) {
|
||||
var block = postponedMessages.First ().Key;
|
||||
DataflowMessageHeader header;
|
||||
@ -286,7 +286,7 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
postponedProcessing.Value = false;
|
||||
|
||||
// because of race
|
||||
if ((Thread.VolatileRead (ref itemCount) < options.BoundedCapacity
|
||||
if ((Volatile.Read (ref itemCount) < options.BoundedCapacity
|
||||
|| MessageQueue.IsAddingCompleted)
|
||||
&& !postponedMessages.IsEmpty)
|
||||
EnsurePostponedProcessing ();
|
||||
@ -329,4 +329,4 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
CompHelper.Complete ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
{
|
||||
firstOffering = true;
|
||||
currentItem = item;
|
||||
Thread.VolatileWrite (ref currentMessageHeaderId, ++lastMessageHeaderId);
|
||||
Volatile.Write (ref currentMessageHeaderId, ++lastMessageHeaderId);
|
||||
|
||||
ClearUnpostponed ();
|
||||
}
|
||||
@ -184,14 +184,14 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
public void ResetCurrentItem ()
|
||||
{
|
||||
currentItem = default(T);
|
||||
Thread.VolatileWrite (ref currentMessageHeaderId, 0);
|
||||
Volatile.Write (ref currentMessageHeaderId, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is there an item to send right now?
|
||||
/// </summary>
|
||||
public bool HasCurrentItem {
|
||||
get { return Thread.VolatileRead (ref currentMessageHeaderId) != 0; }
|
||||
get { return Volatile.Read (ref currentMessageHeaderId) != 0; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -352,7 +352,7 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
/// </summary>
|
||||
public bool VerifyHeader (DataflowMessageHeader header)
|
||||
{
|
||||
return header.Id == Thread.VolatileRead (ref currentMessageHeaderId);
|
||||
return header.Id == Volatile.Read (ref currentMessageHeaderId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,4 +520,4 @@ namespace System.Threading.Tasks.Dataflow {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,4 @@ System.Threading.Tasks.Dataflow/OutputAvailableTest.cs
|
||||
System.Threading.Tasks.Dataflow/EncapsulateTest.cs
|
||||
System.Threading.Tasks.Dataflow/ChooseTest.cs
|
||||
../System.Threading.Tasks.Dataflow/CompletionHelper.cs
|
||||
../../corlib/System.Threading/AtomicBoolean.cs
|
||||
../../Mono.Parallel/Mono.Threading/AtomicBoolean.cs
|
||||
|
@ -133,7 +133,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
|
||||
Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1);
|
||||
|
||||
Assert.AreEqual (2, Thread.VolatileRead (ref n));
|
||||
Assert.AreEqual (2, Volatile.Read (ref n));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -156,7 +156,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
|
||||
Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1);
|
||||
|
||||
Assert.AreEqual (2, Thread.VolatileRead (ref n));
|
||||
Assert.AreEqual (2, Volatile.Read (ref n));
|
||||
}
|
||||
|
||||
int n;
|
||||
@ -181,7 +181,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
|
||||
Assert.IsFalse (transform.Post (102));
|
||||
|
||||
Assert.AreEqual (10000, Thread.VolatileRead (ref n));
|
||||
Assert.AreEqual (10000, Volatile.Read (ref n));
|
||||
}
|
||||
|
||||
IEnumerable<int> ComputeResults ()
|
||||
@ -318,4 +318,4 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
|
||||
var blocks = GetExecutionBlocksWithAction (() =>
|
||||
{
|
||||
if (Thread.VolatileRead (ref shouldRun) == 0) {
|
||||
if (Volatile.Read (ref shouldRun) == 0) {
|
||||
ranAfterFault++;
|
||||
return;
|
||||
}
|
||||
@ -122,7 +122,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
|
||||
Thread.Sleep (100);
|
||||
|
||||
Assert.AreEqual (0, Thread.VolatileRead (ref ranAfterFault));
|
||||
Assert.AreEqual (0, Volatile.Read (ref ranAfterFault));
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
|
||||
var blocks = GetExecutionBlocksWithAsyncAction (
|
||||
i =>
|
||||
tcs.Task.ContinueWith (t => Thread.VolatileWrite (ref result, i + t.Result)),
|
||||
tcs.Task.ContinueWith (t => Volatile.Write (ref result, i + t.Result)),
|
||||
new ExecutionDataflowBlockOptions { TaskScheduler = scheduler });
|
||||
|
||||
foreach (var block in blocks) {
|
||||
@ -160,7 +160,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
Assert.AreEqual (11, result);
|
||||
|
||||
tcs = new TaskCompletionSource<int> ();
|
||||
Thread.VolatileWrite (ref result, 0);
|
||||
Volatile.Write (ref result, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,4 +196,4 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -215,10 +215,10 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
|
||||
Assert.IsTrue (action.Post (1));
|
||||
|
||||
Assert.AreEqual (0, Thread.VolatileRead (ref n));
|
||||
Assert.AreEqual (0, Volatile.Read (ref n));
|
||||
|
||||
Assert.AreEqual (1, scheduler.ExecuteAll ());
|
||||
Assert.AreEqual (1, Thread.VolatileRead (ref n));
|
||||
Assert.AreEqual (1, Volatile.Read (ref n));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -416,4 +416,4 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
|
||||
new[] { task1.Result, task2.Result });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user