亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? io.c

?? 最新的libusb庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
	list_for_each_entry(transfer, &ctx->flying_transfers, list) {		struct timeval *cur_tv = &transfer->timeout;		/* if we've reached transfers of infinite timeout, we're all done */		if (!timerisset(cur_tv))			goto out;		/* ignore timeouts we've already handled */		if (transfer->flags & USBI_TRANSFER_TIMED_OUT)			continue;		/* if transfer has non-expired timeout, nothing more to do */		if ((cur_tv->tv_sec > systime.tv_sec) ||				(cur_tv->tv_sec == systime.tv_sec &&					cur_tv->tv_usec > systime.tv_usec))			goto out;			/* otherwise, we've got an expired timeout to handle */		handle_timeout(transfer);	}out:	pthread_mutex_unlock(&ctx->flying_transfers_lock);	return r;}/* do the actual event handling. assumes that no other thread is concurrently * doing the same thing. */static int handle_events(struct libusb_context *ctx, struct timeval *tv){	int r;	struct usbi_pollfd *ipollfd;	nfds_t nfds = 0;	struct pollfd *fds;	int i = -1;	int timeout_ms;	pthread_mutex_lock(&ctx->pollfds_lock);	list_for_each_entry(ipollfd, &ctx->pollfds, list)		nfds++;	/* TODO: malloc when number of fd's changes, not on every poll */	fds = malloc(sizeof(*fds) * nfds);	if (!fds)		return LIBUSB_ERROR_NO_MEM;	list_for_each_entry(ipollfd, &ctx->pollfds, list) {		struct libusb_pollfd *pollfd = &ipollfd->pollfd;		int fd = pollfd->fd;		i++;		fds[i].fd = fd;		fds[i].events = pollfd->events;		fds[i].revents = 0;	}	pthread_mutex_unlock(&ctx->pollfds_lock);	timeout_ms = (tv->tv_sec * 1000) + (tv->tv_usec / 1000);	/* round up to next millisecond */	if (tv->tv_usec % 1000)		timeout_ms++;	usbi_dbg("poll() %d fds with timeout in %dms", nfds, timeout_ms);	r = poll(fds, nfds, timeout_ms);	usbi_dbg("poll() returned %d", r);	if (r == 0) {		free(fds);		return handle_timeouts(ctx);	} else if (r == -1 && errno == EINTR) {		free(fds);		return LIBUSB_ERROR_INTERRUPTED;	} else if (r < 0) {		free(fds);		usbi_err(ctx, "poll failed %d err=%d\n", r, errno);		return LIBUSB_ERROR_IO;	}	r = usbi_backend->handle_events(ctx, fds, nfds, r);	if (r)		usbi_err(ctx, "backend handle_events failed with error %d", r);	free(fds);	return r;}/* returns the smallest of: *  1. timeout of next URB *  2. user-supplied timeout * returns 1 if there is an already-expired timeout, otherwise returns 0 * and populates out */static int get_next_timeout(libusb_context *ctx, struct timeval *tv,	struct timeval *out){	struct timeval timeout;	int r = libusb_get_next_timeout(ctx, &timeout);	if (r) {		/* timeout already expired? */		if (!timerisset(&timeout))			return 1;		/* choose the smallest of next URB timeout or user specified timeout */		if (timercmp(&timeout, tv, <))			*out = timeout;		else			*out = *tv;	} else {		*out = *tv;	}	return 0;}/** \ingroup poll * Handle any pending events. * * libusb determines "pending events" by checking if any timeouts have expired * and by checking the set of file descriptors for activity. * * If a zero timeval is passed, this function will handle any already-pending * events and then immediately return in non-blocking style. * * If a non-zero timeval is passed and no events are currently pending, this * function will block waiting for events to handle up until the specified * timeout. If an event arrives or a signal is raised, this function will * return early. * * \param ctx the context to operate on, or NULL for the default context * \param tv the maximum time to block waiting for events, or zero for * non-blocking mode * \returns 0 on success, or a LIBUSB_ERROR code on failure */API_EXPORTED int libusb_handle_events_timeout(libusb_context *ctx,	struct timeval *tv){	int r;	struct timeval poll_timeout;	USBI_GET_CONTEXT(ctx);	r = get_next_timeout(ctx, tv, &poll_timeout);	if (r) {		/* timeout already expired */		return handle_timeouts(ctx);	}retry:	if (libusb_try_lock_events(ctx) == 0) {		/* we obtained the event lock: do our own event handling */		r = handle_events(ctx, &poll_timeout);		libusb_unlock_events(ctx);		return r;	}	/* another thread is doing event handling. wait for pthread events that	 * notify event completion. */	libusb_lock_event_waiters(ctx);	if (!libusb_event_handler_active(ctx)) {		/* we hit a race: whoever was event handling earlier finished in the		 * time it took us to reach this point. try the cycle again. */		libusb_unlock_event_waiters(ctx);		usbi_dbg("event handler was active but went away, retrying");		goto retry;	}	usbi_dbg("another thread is doing event handling");	r = libusb_wait_for_event(ctx, &poll_timeout);	libusb_unlock_event_waiters(ctx);	if (r < 0)		return r;	else if (r == 1)		return handle_timeouts(ctx);	else		return 0;}/** \ingroup poll * Handle any pending events in blocking mode with a sensible timeout. This * timeout is currently hardcoded at 2 seconds but we may change this if we * decide other values are more sensible. For finer control over whether this * function is blocking or non-blocking, or the maximum timeout, use * libusb_handle_events_timeout() instead. * * \param ctx the context to operate on, or NULL for the default context * \returns 0 on success, or a LIBUSB_ERROR code on failure */API_EXPORTED int libusb_handle_events(libusb_context *ctx){	struct timeval tv;	tv.tv_sec = 2;	tv.tv_usec = 0;	return libusb_handle_events_timeout(ctx, &tv);}/** \ingroup poll * Handle any pending events by polling file descriptors, without checking if * any other threads are already doing so. Must be called with the event lock * held, see libusb_lock_events(). * * This function is designed to be called under the situation where you have * taken the event lock and are calling poll()/select() directly on libusb's * file descriptors (as opposed to using libusb_handle_events() or similar). * You detect events on libusb's descriptors, so you then call this function * with a zero timeout value (while still holding the event lock). * * \param ctx the context to operate on, or NULL for the default context * \param tv the maximum time to block waiting for events, or zero for * non-blocking mode * \returns 0 on success, or a LIBUSB_ERROR code on failure * \see \ref mtasync */API_EXPORTED int libusb_handle_events_locked(libusb_context *ctx,	struct timeval *tv){	int r;	struct timeval poll_timeout;	USBI_GET_CONTEXT(ctx);	r = get_next_timeout(ctx, tv, &poll_timeout);	if (r) {		/* timeout already expired */		return handle_timeouts(ctx);	}	return handle_events(ctx, &poll_timeout);}/** \ingroup poll * Determine the next internal timeout that libusb needs to handle. You only * need to use this function if you are calling poll() or select() or similar * on libusb's file descriptors yourself - you do not need to use it if you * are calling libusb_handle_events() or a variant directly. *  * You should call this function in your main loop in order to determine how * long to wait for select() or poll() to return results. libusb needs to be * called into at this timeout, so you should use it as an upper bound on * your select() or poll() call. * * When the timeout has expired, call into libusb_handle_events_timeout() * (perhaps in non-blocking mode) so that libusb can handle the timeout. * * This function may return 1 (success) and an all-zero timeval. If this is * the case, it indicates that libusb has a timeout that has already expired * so you should call libusb_handle_events_timeout() or similar immediately. * A return code of 0 indicates that there are no pending timeouts. * * \param ctx the context to operate on, or NULL for the default context * \param tv output location for a relative time against the current * clock in which libusb must be called into in order to process timeout events * \returns 0 if there are no pending timeouts, 1 if a timeout was returned, * or LIBUSB_ERROR_OTHER on failure */API_EXPORTED int libusb_get_next_timeout(libusb_context *ctx,	struct timeval *tv){	struct usbi_transfer *transfer;	struct timespec cur_ts;	struct timeval cur_tv;	struct timeval *next_timeout;	int r;	int found = 0;	USBI_GET_CONTEXT(ctx);	pthread_mutex_lock(&ctx->flying_transfers_lock);	if (list_empty(&ctx->flying_transfers)) {		pthread_mutex_unlock(&ctx->flying_transfers_lock);		usbi_dbg("no URBs, no timeout!");		return 0;	}	/* find next transfer which hasn't already been processed as timed out */	list_for_each_entry(transfer, &ctx->flying_transfers, list) {		if (!(transfer->flags & USBI_TRANSFER_TIMED_OUT)) {			found = 1;			break;		}	}	pthread_mutex_unlock(&ctx->flying_transfers_lock);	if (!found) {		usbi_dbg("all URBs have already been processed for timeouts");		return 0;	}	next_timeout = &transfer->timeout;	/* no timeout for next transfer */	if (!timerisset(next_timeout)) {		usbi_dbg("no URBs with timeouts, no timeout!");		return 0;	}	r = clock_gettime(CLOCK_MONOTONIC, &cur_ts);	if (r < 0) {		usbi_err(ctx, "failed to read monotonic clock, errno=%d", errno);		return LIBUSB_ERROR_OTHER;	}	TIMESPEC_TO_TIMEVAL(&cur_tv, &cur_ts);	if (timercmp(&cur_tv, next_timeout, >=)) {		usbi_dbg("first timeout already expired");		timerclear(tv);	} else {		timersub(next_timeout, &cur_tv, tv);		usbi_dbg("next timeout in %d.%06ds", tv->tv_sec, tv->tv_usec);	}	return 1;}/** \ingroup poll * Register notification functions for file descriptor additions/removals. * These functions will be invoked for every new or removed file descriptor * that libusb uses as an event source. * * To remove notifiers, pass NULL values for the function pointers. * * \param ctx the context to operate on, or NULL for the default context * \param added_cb pointer to function for addition notifications * \param removed_cb pointer to function for removal notifications * \param user_data User data to be passed back to callbacks (useful for * passing context information) */API_EXPORTED void libusb_set_pollfd_notifiers(libusb_context *ctx,	libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,	void *user_data){	USBI_GET_CONTEXT(ctx);	ctx->fd_added_cb 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲一二三区| 亚洲成人精品影院| 91麻豆精品视频| 亚洲成人综合网站| 久久精品视频在线看| 色婷婷久久综合| 高清成人在线观看| 亚洲主播在线播放| 中文字幕亚洲精品在线观看| 欧美男生操女生| 99久久精品免费看| 国产在线国偷精品免费看| 亚洲女子a中天字幕| 国产视频一区不卡| 日韩美女视频在线| 欧美精品123区| 欧美性大战久久久| 在线观看国产91| 99国产麻豆精品| av资源网一区| 国产成a人亚洲精| 国产米奇在线777精品观看| 日韩1区2区日韩1区2区| 亚洲国产日韩精品| 亚洲国产精品一区二区尤物区| 中文在线一区二区| 一区在线中文字幕| 综合在线观看色| 樱桃国产成人精品视频| 亚洲丝袜精品丝袜在线| 中文字幕视频一区| 伊人夜夜躁av伊人久久| 夜夜精品视频一区二区| 亚洲二区视频在线| 午夜精品久久久久久久久久久| 国产精品久久久久久久久免费丝袜 | 久久蜜桃av一区二区天堂| 一本高清dvd不卡在线观看| 国产sm精品调教视频网站| 99精品视频一区| 欧美三级电影精品| 国产日韩欧美制服另类| 亚洲欧美怡红院| 日韩经典一区二区| 国产盗摄女厕一区二区三区| 91色porny在线视频| 欧美精品久久天天躁| 精品国产乱码久久久久久浪潮 | 欧美日韩二区三区| 国产亚洲综合在线| 日本vs亚洲vs韩国一区三区| 国产91精品入口| 欧美精选一区二区| 亚洲精品成人a在线观看| 久久99久国产精品黄毛片色诱| 91免费视频网| 久久久99精品久久| 国产精品国产馆在线真实露脸 | 日韩中文字幕麻豆| 色94色欧美sute亚洲线路一久| 欧美一区永久视频免费观看| 国产精品污污网站在线观看| 久久精品国产精品亚洲精品| 欧洲另类一二三四区| 国产精品不卡一区| 成人一区二区视频| 国产亚洲欧美日韩在线一区| 美腿丝袜亚洲三区| 91精品久久久久久蜜臀| 午夜不卡av在线| 欧美精品在线视频| 捆绑变态av一区二区三区| 欧美精品一二三四| 日韩精品色哟哟| 国产成人精品影院| 日韩片之四级片| 国产寡妇亲子伦一区二区| 精品成人佐山爱一区二区| 久久av老司机精品网站导航| 精品国产乱码久久久久久浪潮 | 欧美岛国在线观看| 国产剧情一区二区| 亚洲人成在线播放网站岛国| 色94色欧美sute亚洲线路二| 亚洲综合成人网| 久久精品夜色噜噜亚洲a∨| 成人av动漫在线| 日日夜夜免费精品| 国产日本欧美一区二区| 91福利社在线观看| 韩国三级电影一区二区| 亚洲精品国产精华液| 精品国产乱码久久久久久久| 96av麻豆蜜桃一区二区| 捆绑调教美女网站视频一区| 伊人性伊人情综合网| 国产欧美日韩视频一区二区| 欧美三级电影网| 91搞黄在线观看| 国产电影一区二区三区| 精品一区二区免费| 亚洲国产美女搞黄色| 中文字幕在线不卡国产视频| 久久欧美中文字幕| 欧美一级日韩一级| 精品视频色一区| 欧美午夜精品电影| 色伊人久久综合中文字幕| 盗摄精品av一区二区三区| 久久精品国产一区二区三区免费看| 午夜久久福利影院| 午夜久久久影院| 日本女优在线视频一区二区| 亚洲18色成人| 三级欧美在线一区| 国产精品久久久久9999吃药| 欧美一区二区三区色| 欧美一二三四在线| 日韩一区二区电影| 国产亚洲综合在线| 专区另类欧美日韩| 亚洲成人在线观看视频| 亚洲gay无套男同| 国产自产高清不卡| 成a人片国产精品| 在线观看视频一区二区| 欧美日韩一卡二卡三卡| 91麻豆精品国产91久久久使用方法| 欧美日韩国产首页在线观看| 久久这里只有精品首页| 亚洲欧美国产毛片在线| 日本不卡在线视频| 成人性生交大合| 欧美一区二区播放| 国产精品国产三级国产aⅴ无密码| 亚洲成a人片综合在线| 国产成人福利片| 制服.丝袜.亚洲.中文.综合| 中文字幕av免费专区久久| 午夜久久福利影院| 色吊一区二区三区| 国产日产欧美一区| 国产精品18久久久久久久久 | www.日本不卡| 精品国产成人在线影院| 日本sm残虐另类| 91麻豆精品国产自产在线观看一区 | 国产精品卡一卡二| 麻豆精品国产91久久久久久| 欧美视频在线观看一区| 亚洲人成网站在线| 色一情一乱一乱一91av| 亚洲欧美激情在线| 91福利在线免费观看| 亚洲欧美区自拍先锋| 91麻豆.com| 亚洲一区在线观看免费 | 1区2区3区国产精品| 国产精品一区一区三区| 国产午夜精品在线观看| 国产精品自拍在线| 国产欧美日韩不卡免费| 国产麻豆精品95视频| 26uuu精品一区二区在线观看| 蜜桃一区二区三区在线观看| 欧美一区二区在线视频| 热久久一区二区| 国产免费观看久久| 一本大道久久a久久精二百| 最新国产精品久久精品| 91小视频免费看| 轻轻草成人在线| 久久品道一品道久久精品| 欧美综合欧美视频| 久久99精品网久久| 国产精品不卡一区| 欧美放荡的少妇| 99精品国产热久久91蜜凸| 青青草国产成人99久久| 国产午夜精品美女毛片视频| 色综合久久66| 国产成人免费视频精品含羞草妖精 | 午夜激情一区二区| 久久综合九色综合97婷婷| 在线观看视频欧美| 97aⅴ精品视频一二三区| 国产乱码精品一区二区三区五月婷 | 成人性生交大合| 日本美女一区二区| 亚洲国产毛片aaaaa无费看| 久久久精品黄色| 精品少妇一区二区三区在线播放| 97精品国产露脸对白| 丰满少妇在线播放bd日韩电影| 蜜芽一区二区三区| 韩国女主播一区| 国产另类ts人妖一区二区| 免费在线观看一区| 久久精品久久精品| 国产福利一区在线观看|