/* acquire exclusive write write lock for this directory */
void acquireWritable() throws IOException {
synchronized (openFileWrites) {
if (writeMutexFile == null) {
FileChannel tmp = FileChannel.open(streamDirectory.resolve("mff.lock"), READ, WRITE, CREATE);
writeMutexLock = tmp.lock();
if (writeMutexLock == null || writeMutexLock.isShared()) {
throw new IOException("unable to acquire exclusive writeLock for directory " + streamDirectory);
}
writeMutexFile = tmp;
publishEvent(MuxyFileEvent.WRITE_LOCK_ACQUIRED, writeMutexLock);