Added a shared lock to each ResourceManager so you can be sure that only one Thread can write into it