'Provide a context manager for the "write" lock.
This method makes use of :meth:`.AbstractFileLock.acquire_write_lock`
and :meth:`.AbstractFileLock.release_write_lock`'

@contextmanager
def write(self):

    self.acquire_write_lock(True)
    try:
        (yield)
    finally:
        self.release_write_lock()
