//Get a reference to the lock
//Needs to be synched in case new lock isn't yet stored
//when another thread asks for the same lock
private static synchronized InterProcessReadWriteLock getLock(String filename){
//Lock container
InterProcessReadWriteLock lock;
//Check if the lock is already created and in the store
//Otherwise generate a new lock and store it
if(lockStore.containsKey(filename)){
lock = lockStore.get(filename);
logger.debug("Reused an old lock");
}else{
lock = new InterProcessReadWriteLock(ZKSynch.client,filename);
lockStore.put(filename, lock);
logger.debug("Made a new lock");
}
//Return the pointer to the lock