def _next_channel(self):
chanid = self._channel_counter<EOL>while self._channels.get(chanid) is not None:<EOL><INDENT>self._channel_counter = (self._channel_counter + <NUM_LIT:1>) & <NUM_LIT><EOL>chanid = self._channel_counter<EOL><DEDENT>self._channel_counter = (self._channel_counter + <NUM_LIT:1>) & <NUM_LIT><EOL>return chanid<EOL>
you are holding the lock