code: def remove_all_locks(self):
          
          locks = list(self._locks.items())
          locks.sort(key=lambda l: l[1].get_last_access())
          for l in locks:
              self._remove_lock(l[0])
docs: Removes all locks and ensures their content is written to disk.