io/m_event_poll.c
/*! Wait for events with timeout in milliseconds.
 *  \param data       implementation-specific data
 *  \param timeout_ms Timeout in milliseconds.  -1 for infinite,
 *                    0 returns immediately after checking events,
 *                    >0 milliseconds to wait
 *  \return M_TRUE if events were available, M_FALSE if timeout
 */
Wait for events with timeout in milliseconds.
\param data       implementation-specific data
\param timeout_ms Timeout in milliseconds.  -1 for infinite,
0 returns immediately after checking events,
>0 milliseconds to wait
\return M_TRUE if events were available, M_FALSE if timeout
Wait for events with timeout in milliseconds . \ param data implementation - specific data \ param timeout_ms Timeout in milliseconds . - 1 for infinite 0 returns immediately after checking events > 0 milliseconds to wait \ return M_TRUE if events were available M_FALSE if timeout
static M_bool M_event_impl_poll_wait(M_event_t *event, M_uint64 timeout_ms)
{
	M_bool is_inf = (timeout_ms == M_TIMEOUT_INF)?M_TRUE:M_FALSE;
	if (timeout_ms > M_INT32_MAX)
		timeout_ms = M_INT32_MAX;
	event->u.loop.impl_data->retval = M_thread_poll(event->u.loop.impl_data->fds, event->u.loop.impl_data->num_fds,
	                                                (is_inf)?-1:(int)timeout_ms);
	if (event->u.loop.impl_data->retval > 0) {
		return M_TRUE;
	}
	return M_FALSE;
}
static M_bool M_event_impl_poll_wait ( M_event_t * event , M_uint64 timeout_ms ) { M_bool is_inf = ( timeout_ms == M_TIMEOUT_INF ) ? M_TRUE : M_FALSE ; if ( timeout_ms > M_INT32_MAX ) timeout_ms = M_INT32_MAX ; event -> u . loop . impl_data -> retval = M_thread_poll ( event -> u . loop . impl_data -> fds , event -> u . loop . impl_data -> num_fds , ( is_inf ) ? -1 : ( int ) timeout_ms ) ; if ( event -> u . loop . impl_data -> retval > 0 ) { return M_TRUE ; } return M_FALSE ; }
Wait for events with timeout in milliseconds.
Wait for events with timeout in milliseconds .