Created
April 6, 2025 22:01
-
-
Save AnthonyGiretti/58dddfe943e98475fa530090bed17154 to your computer and use it in GitHub Desktop.
Locking with C# 13
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
private System.Threading.Lock _lock = new(); | |
void Update() | |
{ | |
lock (_lock) | |
{ | |
// safely synchronized | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment