Skip to content

Instantly share code, notes, and snippets.

@AnthonyGiretti
Created April 6, 2025 22:01
Show Gist options
  • Save AnthonyGiretti/58dddfe943e98475fa530090bed17154 to your computer and use it in GitHub Desktop.
Save AnthonyGiretti/58dddfe943e98475fa530090bed17154 to your computer and use it in GitHub Desktop.
Locking with C# 13
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