'Lock the entire multistore.'

def _lock(self):

    self._thread_lock.acquire()
    self._file.open_and_lock()
    if (not self._file.is_locked()):
        self._read_only = True
        if self._warn_on_readonly:
            logger.warn(('The    credentials    file    (%s)    is    not    writable.    Opening    in    read-only    mode.    Any    refreshed    credentials    will    only    be    valid    for    this    run.' % self._file.filename()))
    if (os.path.getsize(self._file.filename()) == 0):
        logger.debug('Initializing    empty    multistore    file')
        self._data = {}
        self._write()
    elif ((not self._read_only) or (self._data is None)):
        self._refresh_data_cache()
