Can I add an attribute to a function to prevent reentry?

前端 未结 9 2329
梦谈多话
梦谈多话 2021-02-15 12:26

At the moment, I have some functions which look like this:

private bool inFunction1 = false;
public void function1()
{
    if (inFunction1) return;
    inFunctio         


        
9条回答
  •  名媛妹妹
    2021-02-15 13:14

    I dont think that will be possible.

    The closest will be the the 'Synchronized' attribute, but that will block all subsequent calls.

提交回复
热议问题