[][src]Function android_looper_sys::ALooper_removeFd

pub unsafe extern "C" fn ALooper_removeFd(
    looper: *mut ALooper,
    fd: c_int
) -> c_int

Removes a previously added file descriptor from the looper.

When this method returns, it is safe to close the file descriptor since the looper will no longer have a reference to it. However, it is possible for the callback to already be running or for it to run one last time if the file descriptor was already signalled. Calling code is responsible for ensuring that this case is safely handled. For example, if the callback takes care of removing itself during its own execution either by returning 0 or by calling this method, then it can be guaranteed to not be invoked again at any later time unless registered anew.

Returns 1 if the file descriptor was removed, 0 if none was previously registered or -1 if an error occurred.

This method can be called on any thread.

This method may block briefly if it needs to wake the poll.