Function android_looper_sys::ALooper_pollOnce [] [src]

pub unsafe extern fn ALooper_pollOnce(timeoutMillis: c_int,
                                      outFd: *mut c_int,
                                      outEvents: *mut c_int,
                                      outData: *mut *mut c_void)
                                      -> c_int

Waits for events to be available, with optional timeout in milliseconds. Invokes callbacks for all file descriptors on which an event occurred.

If the timeout is zero, returns immediately without blocking. If the timeout is negative, waits indefinitely until an event appears.

Returns ALOOPER_POLL_WAKE if the poll was awoken using wake() before the timeout expired and no callbacks were invoked and no other file descriptors were ready.

Returns ALOOPER_POLL_CALLBACK if one or more callbacks were invoked.

Returns ALOOPER_POLL_TIMEOUT if there was no data before the given timeout expired.

Returns ALOOPER_POLL_ERROR if an error occurred.

Returns a value >= 0 containing an identifier if its file descriptor has data and it has no callback function (requiring the caller here to handle it). In this (and only this) case outFd, outEvents and outData will contain the poll events and data associated with the fd, otherwise they will be set to NULL.

This method does not return until it has finished invoking the appropriate callbacks for all file descriptors that were signalled.