C# release lock automatically after timeout
问题 does anyone have any ideas on whats the best way to implement a lock so that after X number of seconds it will automatically be released ? 回答1: In web development, I cache all the time with a sliding timeout. Perhaps you could use a cached object as the lock? Here's a discussion of caching technologies in non-web applications: Caching in C# without System.Web 回答2: Assuming you are looking for an event to fire in X seconds, then I don't think there's any core Mutex object which currently