Skip to content

Commit 8cb2e94

Browse files
authored
Merge pull request #62 from nblumhardt/ci-updates
Switch to the VS2022 build worker and .NET 6 SDK
2 parents d6b36c1 + 3af92b5 commit 8cb2e94

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2019
3+
image: Visual Studio 2022
44
test: off
55
build_script:
66
- ps: ./Build.ps1

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk": {
33
"allowPrerelease": false,
4-
"version": "5.0.409",
4+
"version": "6.0.300",
55
"rollForward": "latestFeature"
66
}
77
}

src/Serilog.Extensions.Hosting/Extensions/Hosting/ReloadableLogger.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,13 @@ public bool BindProperty(string propertyName, object value, bool destructureObje
368368
[MethodImpl(MethodImplOptions.AggressiveInlining)]
369369
(ILogger, bool) UpdateForCaller(ILogger root, ILogger cached, IReloadableLogger caller, out ILogger newRoot, out ILogger newCached, out bool frozen)
370370
{
371+
// Synchronization on `_sync` is not required in this method; it will be called without a lock
372+
// if `_frozen` and under a lock if not.
373+
371374
if (_frozen)
372375
{
373-
// If we're frozen, then the caller hasn't observed this yet and should update.
376+
// If we're frozen, then the caller hasn't observed this yet and should update. We could optimize a little here
377+
// and only signal an update if the cached logger is stale (as per the next condition below).
374378
newRoot = _logger;
375379
newCached = caller.ReloadLogger();
376380
frozen = true;
@@ -384,7 +388,7 @@ public bool BindProperty(string propertyName, object value, bool destructureObje
384388
frozen = false;
385389
return (cached, false);
386390
}
387-
391+
388392
newRoot = _logger;
389393
newCached = caller.ReloadLogger();
390394
frozen = false;

test/Serilog.Extensions.Hosting.Tests/Serilog.Extensions.Hosting.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net5.0;net4.8</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net6.0;net4.8</TargetFrameworks>
55
<AssemblyName>Serilog.Extensions.Hosting.Tests</AssemblyName>
66
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
77
<SignAssembly>true</SignAssembly>

0 commit comments

Comments
 (0)