Skip to content

Commit

Permalink
Merge branch 'main' into users/evgenyfedorov2/fix_cpushare_to_weight_…
Browse files Browse the repository at this point in the history
…conversion
  • Loading branch information
RussKie authored Aug 4, 2024
2 parents 8f32667 + 601ec1e commit 85ab682
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
9 changes: 9 additions & 0 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ This sets up necessary environmental variables and opens the repository in VS Co
* When restoring packages, if you get the following message: "The SSL connection could not be established, see inner exception. Unable to read data from the transport connection", try disabling IPv6 on your network adapter.
* When the public API surface is updated, you need to update the API baselines manifest files for the impacted assemblies. [Here is an example](https://github.com/dotnet/extensions/blob/3e6ac0735cb62d4c8b63e131d956397a87ea26f7/src/Libraries/Microsoft.Extensions.AsyncState/Microsoft.Extensions.AsyncState.json) for the `Microsoft.Extensions.AsyncState` project. To update the manifest of all the local assemblies, invoke the script `./scripts/MakeApiBaselines.ps1`.

#### How to fix "Workload manifest microsoft.net.sdk.aspire not installed"?

At times, during restore you may receive the following error:
```
error MSB4242: SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.DotNet.Arcade.Sdk".
Exception: "System.IO.FileNotFoundException: Workload manifest microsoft.net.sdk.aspire: 8.0.1/8.0.100 from workload version <x.y.z> was not installed. Running "dotnet workload repair" may resolve this.
```

This error is, generally, caused by multiple SDK installations under \<root\>/.dotnet folder. To resolve the issue, run `git clean -xdf` and then run restore again.

---

Expand Down
17 changes: 10 additions & 7 deletions src/Libraries/Microsoft.Extensions.TimeProvider.Testing/Timer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ public bool Change(TimeSpan dueTime, TimeSpan period)
_ = Throw.IfOutOfRange(periodMs, -1, MaxSupportedTimeout, nameof(period));
#pragma warning restore S3236 // Caller information arguments should not be provided explicitly

if (_timeProvider == null)
var timeProvider = _timeProvider;
if (timeProvider is null)
{
// timer has been disposed
return false;
}

if (_waiter != null)
var waiter = _waiter;
if (waiter is not null)
{
// remove any previous waiter
_timeProvider.RemoveWaiter(_waiter);
timeProvider.RemoveWaiter(waiter);
_waiter = null;
}

Expand All @@ -62,8 +64,8 @@ public bool Change(TimeSpan dueTime, TimeSpan period)
period = TimeSpan.Zero;
}

_waiter = new Waiter(_callback!, _state, period.Ticks);
_timeProvider.AddWaiter(_waiter, dueTime.Ticks);
_waiter = waiter = new Waiter(_callback!, _state, period.Ticks);
timeProvider.AddWaiter(waiter, dueTime.Ticks);
return true;
}

Expand All @@ -89,9 +91,10 @@ public ValueTask DisposeAsync()

private void Dispose(bool _)
{
if (_waiter != null)
var waiter = _waiter;
if (waiter is not null)
{
_timeProvider!.RemoveWaiter(_waiter);
_timeProvider?.RemoveWaiter(waiter);
_waiter = null;
}

Expand Down

0 comments on commit 85ab682

Please sign in to comment.