<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_all_locks(self):
 """Removes all locks and ensures their content is written to disk."""

        locks = list(self._locks.items())
        locks.sort(key=lambda l: l[1].get_last_access())
        for l in locks:
            self._remove_lock(l[0])