Created
July 15, 2020 23:39
-
-
Save dcomartin/8bed09be0c7163cbea5dfd9835b9e3a6 to your computer and use it in GitHub Desktop.
This file contains 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
public class ClassC | |
{ | |
private string? _state; | |
public async Task<int> NotThreadSafe(string state) | |
{ | |
_state = state; | |
// Delay this Task so we can end up having ClassB change the state before we return the length | |
if (state.Length > 0) | |
{ | |
await Task.Delay(10); | |
} | |
return _state.Length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment