I wrote a DLL in .NET. I have a public function that controls access to another public function. For instance, once function #1 is called, function #2 has to return false until function #1 is finished. For this, I set just set a flag, turn it on when function 1 is started, and off when finished.
What would happen if someone using this DLL had instantiated one instance of this DLL to call function #1, and another to call function #2. That flag would not be set correctly in #2 right? How could I control this? What is the best practice?
What would happen if someone using this DLL had instantiated one instance of this DLL to call function #1, and another to call function #2. That flag would not be set correctly in #2 right? How could I control this? What is the best practice?
Comment