There are several folders on back-end of Web API server. Each of them is a git repository. Let's call them
- Project1
- Project2
- Project3
How can I create lock on server so only one user (thread) in a project can work with a particular folder? Currently I've implemented simple lock using static object and Monitor class. But in this case access to folders is locked on a global level whereas lock should be applied on each folder independently.
Which .NET threading instrument would be most suitable in my situation?