def __waituntil(self, stopwaiting, timeoutmsg):
if not stopwaiting():<EOL><INDENT>if self.__timeout == <NUM_LIT:0>:<EOL><INDENT>_macutil.looponce()<EOL>if not stopwaiting():<EOL><INDENT>raise _socket.error(errno.EAGAIN, os.strerror(errno.EAGAIN))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if not _macutil.waituntil(stopwaiting, self.__timeout):<EOL><INDENT>raise _socket.timeout(timeoutmsg)<EOL><DEDENT><DEDENT><DEDENT>
Waits until stopwaiting() returns True, or until the wait times out
(according to the self.__timeout value).

This is to make a function wait until a buffer has been filled. i.e.
stopwaiting() should return True when the buffer is no longer empty.