At the moment, I have some functions which look like this:
private bool inFunction1 = false; public void function1() { if (inFunction1) return; inFunctio
If this is for Thread safety you have to be careful with that variable.
It's possible another thread could come into the function and pass the check before the first thread has set the variable.
Make sure it's marked volatile like so:
private volatile bool inFunction1 = false;