Created
November 21, 2023 18:10
-
-
Save ekalchev/e82c644219f8af2716d7d3340f4aa3f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class Program | |
{ | |
private static Test test; | |
static void Main(string[] args) | |
{ | |
Task.Run(() => | |
{ | |
while (true) | |
{ | |
Test localTest = test; | |
if (localTest != null && localTest.Ref == null) | |
{ | |
} | |
} | |
}); | |
while (true) | |
{ | |
test = null; | |
test = new Test(); | |
} | |
} | |
class Test | |
{ | |
public Test() | |
{ | |
Ref = new object(); | |
} | |
public object Ref { get; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment