Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Mirror changes from dotnet/coreclr#6905

Merged
jkotas merged 4 commits into
dotnet:masterfrom
Dotnet-GitSync-Bot:mirror-merge-10032196
Jan 27, 2019
Merged

Mirror changes from dotnet/coreclr#6905
jkotas merged 4 commits into
dotnet:masterfrom
Dotnet-GitSync-Bot:mirror-merge-10032196

Conversation

@Dotnet-GitSync-Bot
Copy link
Copy Markdown
Contributor

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot commented Jan 27, 2019

This PR contains mirrored changes from dotnet/coreclr

Please REBASE this PR when merging

cc @filipnavara @stephentoub

filipnavara and others added 4 commits January 27, 2019 19:16
* Move Timer to shared CoreLib partition.

* Move SignalNoCallbacksRunning back to shared code, add static EventWaitHandle.Set.

* Remove AppDomain references from shared Timer code, reshuffle some code out of SetTimer in non-shared code.

* Change m_ prefix to match code style.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove defunct netstandard code from ValueTask

* Remove several uses of VoidTaskResult

Currently TrySetResult/Canceled/Exception live on `Task<T>`.  There's no reason `TrySetCanceled` and `TrySetException` need to live there, as they only access state from the base `Task`, and so can be moved down.  `TrySetResult` needs the `TResult`, however in a variety of cases `Task<T>` is used with a `VoidTaskResult`, and for such cases we can just have a parameterless `TrySetResult()` on the base class as well, which can be used any time there is no `TResult` or when `default(TResult)` is the desired result.  This lets us switch several cases where we were using `Task<VoidTaskResult>` to just be `Task`, which saves 8 bytes on the task instance on 64-bit.  It also avoids an Interlocked.Exchange as part of the TrySetResult call.

This primarily affects Task.Delay and the non-generic variants of Task.WhenAll, ValueTask.AsTask(), Task.FromCanceled, and Task.FromException.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Update to code from CoreCLR PR, add EventWaitHandle.Set static method.
@jkotas jkotas merged commit 44d3c55 into dotnet:master Jan 27, 2019
filipnavara added a commit to filipnavara/corert that referenced this pull request Feb 22, 2019
filipnavara added a commit to filipnavara/corert that referenced this pull request Feb 22, 2019
jkotas pushed a commit that referenced this pull request Feb 22, 2019
)

* Fix bug introduced in commit e652d4d (#6905 / #6898)

* Add test for timers created on multiple threads
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants