def _parallel_receive_loop(self, seconds_to_wait):
sleep(seconds_to_wait)<EOL>with self._lock:<EOL><INDENT>self._number_of_threads_receiving_messages += <NUM_LIT:1><EOL><DEDENT>try:<EOL><INDENT>with self._lock:<EOL><INDENT>if self.state.is_waiting_for_start():<EOL><INDENT>self.start()<EOL><DEDENT><DEDENT>while True:<EOL><INDENT>with self.lock:<EOL><INDENT>if self.state.is_connection_closed():<EOL><INDENT>return<EOL><DEDENT>self.receive_message()<EOL><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>with self._lock:<EOL><INDENT>self._number_of_threads_receiving_messages -= <NUM_LIT:1><EOL><DEDENT><DEDENT>
Run the receiving in parallel.