[Solved] How to prevent method from running in multiple instances [closed]
I would use Mutex to avoid multiple access to the same recourses. Here you have a brief piece of code to achieve this Mutex mutex; private void StartPolling() { mutex = new Mutex(true, “same_name_in_here”, out bool createdNew); if (!createdNew) { throw new Exception(“Polling running in other process”); } //now StartPolling can not be called from … Read more