Added compilation warnings, added readers-writers mutex