Helper class that provides locking functionality without fear of deadlocks