<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def flush(self):
        '''Write all the enqueued bytestring before this flush call to disk.
        Block until all the above bytestring are written.
        '''
        with self._lock:
            if self._closed:
                raise IOError('Writer is closed')
            self._byte_queue.join()
            self._writer.flush()