You've already forked linux-packaging-mono
Imported Upstream version 5.10.0.47
Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
parent
88ff76fe28
commit
e46a49ecf1
@ -317,7 +317,7 @@ namespace System.Threading.Tasks.Tests
|
||||
conTask.Wait();
|
||||
Assert.True(conTask.Result, "The concurrenttask when executed successfully should have returned true");
|
||||
|
||||
//Now scehdule a exclusive task that is blocked(thereby preventing other concurrent tasks to finish)
|
||||
//Now scehdule an exclusive task that is blocked(thereby preventing other concurrent tasks to finish)
|
||||
Task<bool> exclusiveTask = writers.StartNew<bool>(() => { blockMainThreadEvent.Set(); blockExclusiveTaskEvent.WaitOne(); return true; });
|
||||
|
||||
//With exclusive task in execution mode, schedule a number of concurrent tasks and ensure they are not executed
|
||||
@ -328,7 +328,7 @@ namespace System.Threading.Tasks.Tests
|
||||
foreach (Task task in taskList)
|
||||
{
|
||||
bool wasTaskStarted = (task.Status != TaskStatus.Running) && (task.Status != TaskStatus.RanToCompletion);
|
||||
Assert.True(wasTaskStarted, "Concurrent tasks should not be executed when a exclusive task is getting executed");
|
||||
Assert.True(wasTaskStarted, "Concurrent tasks should not be executed when an exclusive task is getting executed");
|
||||
}
|
||||
|
||||
blockExclusiveTaskEvent.Set();
|
||||
|
@ -11,7 +11,7 @@ using Xunit;
|
||||
|
||||
namespace System.Threading.Tasks.Tests
|
||||
{
|
||||
public static class CancellationTokenTests
|
||||
public static partial class CancellationTokenTests
|
||||
{
|
||||
[Fact]
|
||||
public static void CancellationTokenRegister_Exceptions()
|
||||
|
30
external/corefx/src/System.Threading.Tasks/tests/CancellationTokenTests.netcoreapp.cs
vendored
Normal file
30
external/corefx/src/System.Threading.Tasks/tests/CancellationTokenTests.netcoreapp.cs
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace System.Threading.Tasks.Tests
|
||||
{
|
||||
public static partial class CancellationTokenTests
|
||||
{
|
||||
[Fact]
|
||||
public static void CancellationTokenRegistration_Token_MatchesExpectedValue()
|
||||
{
|
||||
Assert.Equal(default(CancellationToken), default(CancellationTokenRegistration).Token);
|
||||
|
||||
var cts = new CancellationTokenSource();
|
||||
Assert.NotEqual(default(CancellationToken), cts.Token);
|
||||
|
||||
using (var ctr = cts.Token.Register(() => { }))
|
||||
{
|
||||
Assert.Equal(cts.Token, ctr.Token);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -54,6 +54,7 @@
|
||||
<Compile Include="Task\TaskDisposeTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
|
||||
<Compile Include="CancellationTokenTests.netcoreapp.cs" />
|
||||
<Compile Include="Task\TaskStatusTest.netcoreapp.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
|
@ -28,7 +28,7 @@ namespace System.Threading.Tasks.Tests
|
||||
private bool _hasReturnType;
|
||||
|
||||
/// <summary>
|
||||
/// Used to synchornize between Main thread and async thread, by blocking the main thread until
|
||||
/// Used to synchronize between Main thread and async thread, by blocking the main thread until
|
||||
/// the thread that invokes the TaskCompleted method via AsyncCallback finishes
|
||||
/// </summary>
|
||||
private ManualResetEvent _mre = new ManualResetEvent(false);
|
||||
|
@ -41,7 +41,7 @@ namespace System.Threading.Tasks.Tests
|
||||
|
||||
public enum WorkloadType
|
||||
{
|
||||
CreateChildTask, //Start a attached childTask in the workload
|
||||
CreateChildTask, //Start an attached childTask in the workload
|
||||
CreateDetachedChildTask, //start a detached childTask in the workload
|
||||
ContinueInside, //Invoke continuewith as the workload inside the task
|
||||
RunWithUserScheduler, //create a task with custom task scheduler that runs that task inline
|
||||
|
Reference in New Issue
Block a user