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

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

?? io.c

?? 最新的libusb庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
 * \param transfer the transfer to submit * \returns 0 on success * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected * \returns another LIBUSB_ERROR code on other failure */API_EXPORTED int libusb_submit_transfer(struct libusb_transfer *transfer){	struct usbi_transfer *itransfer =		__LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);	int r;	itransfer->transferred = 0;	r = calculate_timeout(itransfer);	if (r < 0)		return LIBUSB_ERROR_OTHER;	add_to_flying_list(itransfer);	r = usbi_backend->submit_transfer(itransfer);	if (r) {		pthread_mutex_lock(&TRANSFER_CTX(transfer)->flying_transfers_lock);		list_del(&itransfer->list);		pthread_mutex_unlock(&TRANSFER_CTX(transfer)->flying_transfers_lock);	}	return r;}/** \ingroup asyncio * Asynchronously cancel a previously submitted transfer. * It is undefined behaviour to call this function on a transfer that is * already being cancelled or has already completed. * This function returns immediately, but this does not indicate cancellation * is complete. Your callback function will be invoked at some later time * with a transfer status of * \ref libusb_transfer_status::LIBUSB_TRANSFER_CANCELLED * "LIBUSB_TRANSFER_CANCELLED." * * \param transfer the transfer to cancel * \returns 0 on success * \returns a LIBUSB_ERROR code on failure */API_EXPORTED int libusb_cancel_transfer(struct libusb_transfer *transfer){	struct usbi_transfer *itransfer =		__LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);	int r;	usbi_dbg("");	r = usbi_backend->cancel_transfer(itransfer);	if (r < 0)		usbi_err(TRANSFER_CTX(transfer),			"cancel transfer failed error %d", r);	return r;}/* Handle completion of a transfer (completion might be an error condition). * This will invoke the user-supplied callback function, which may end up * freeing the transfer. Therefore you cannot use the transfer structure * after calling this function, and you should free all backend-specific * data before calling it. */void usbi_handle_transfer_completion(struct usbi_transfer *itransfer,	enum libusb_transfer_status status){	struct libusb_transfer *transfer =		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);	struct libusb_context *ctx = TRANSFER_CTX(transfer);	uint8_t flags;	pthread_mutex_lock(&ctx->flying_transfers_lock);	list_del(&itransfer->list);	pthread_mutex_unlock(&ctx->flying_transfers_lock);	if (status == LIBUSB_TRANSFER_COMPLETED			&& transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) {		int rqlen = transfer->length;		if (transfer->type == LIBUSB_TRANSFER_TYPE_CONTROL)			rqlen -= LIBUSB_CONTROL_SETUP_SIZE;		if (rqlen != itransfer->transferred) {			usbi_dbg("interpreting short transfer as error");			status = LIBUSB_TRANSFER_ERROR;		}	}	flags = transfer->flags;	transfer->status = status;	transfer->actual_length = itransfer->transferred;	if (transfer->callback)		transfer->callback(transfer);	/* transfer might have been freed by the above call, do not use from	 * this point. */	if (flags & LIBUSB_TRANSFER_FREE_TRANSFER)		libusb_free_transfer(transfer);	pthread_mutex_lock(&ctx->event_waiters_lock);	pthread_cond_broadcast(&ctx->event_waiters_cond);	pthread_mutex_unlock(&ctx->event_waiters_lock);}/* Similar to usbi_handle_transfer_completion() but exclusively for transfers * that were asynchronously cancelled. The same concerns w.r.t. freeing of * transfers exist here. */void usbi_handle_transfer_cancellation(struct usbi_transfer *transfer){	/* if the URB was cancelled due to timeout, report timeout to the user */	if (transfer->flags & USBI_TRANSFER_TIMED_OUT) {		usbi_dbg("detected timeout cancellation");		usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_TIMED_OUT);		return;	}	/* otherwise its a normal async cancel */	usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_CANCELLED);}/** \ingroup poll * Attempt to acquire the event handling lock. This lock is used to ensure that * only one thread is monitoring libusb event sources at any one time. * * You only need to use this lock if you are developing an application * which calls poll() or select() on libusb's file descriptors directly. * If you stick to libusb's event handling loop functions (e.g. * libusb_handle_events()) then you do not need to be concerned with this * locking. * * While holding this lock, you are trusted to actually be handling events. * If you are no longer handling events, you must call libusb_unlock_events() * as soon as possible. * * \param ctx the context to operate on, or NULL for the default context * \returns 0 if the lock was obtained successfully * \returns 1 if the lock was not obtained (i.e. another thread holds the lock) * \see \ref mtasync */API_EXPORTED int libusb_try_lock_events(libusb_context *ctx){	int r;	USBI_GET_CONTEXT(ctx);		r = pthread_mutex_trylock(&ctx->events_lock);	if (r)		return 1;	ctx->event_handler_active = 1;		return 0;}/** \ingroup poll * Acquire the event handling lock, blocking until successful acquisition if * it is contended. This lock is used to ensure that only one thread is * monitoring libusb event sources at any one time. * * You only need to use this lock if you are developing an application * which calls poll() or select() on libusb's file descriptors directly. * If you stick to libusb's event handling loop functions (e.g. * libusb_handle_events()) then you do not need to be concerned with this * locking. * * While holding this lock, you are trusted to actually be handling events. * If you are no longer handling events, you must call libusb_unlock_events() * as soon as possible. * * \param ctx the context to operate on, or NULL for the default context * \see \ref mtasync */API_EXPORTED void libusb_lock_events(libusb_context *ctx){	USBI_GET_CONTEXT(ctx);	pthread_mutex_lock(&ctx->events_lock);	ctx->event_handler_active = 1;}/** \ingroup poll * Release the lock previously acquired with libusb_try_lock_events() or * libusb_lock_events(). Releasing this lock will wake up any threads blocked * on libusb_wait_for_event(). * * \param ctx the context to operate on, or NULL for the default context * \see \ref mtasync */API_EXPORTED void libusb_unlock_events(libusb_context *ctx){	USBI_GET_CONTEXT(ctx);	ctx->event_handler_active = 0;	pthread_mutex_unlock(&ctx->events_lock);	pthread_mutex_lock(&ctx->event_waiters_lock);	pthread_cond_broadcast(&ctx->event_waiters_cond);	pthread_mutex_unlock(&ctx->event_waiters_lock);}/** \ingroup poll * Determine if an active thread is handling events (i.e. if anyone is holding * the event handling lock). * * \param ctx the context to operate on, or NULL for the default context * \returns 1 if a thread is handling events * \returns 0 if there are no threads currently handling events * \see \ref mtasync */API_EXPORTED int libusb_event_handler_active(libusb_context *ctx){	USBI_GET_CONTEXT(ctx);	return ctx->event_handler_active;}/** \ingroup poll * Acquire the event waiters lock. This lock is designed to be obtained under * the situation where you want to be aware when events are completed, but * some other thread is event handling so calling libusb_handle_events() is not * allowed. * * You then obtain this lock, re-check that another thread is still handling * events, then call libusb_wait_for_event(). * * You only need to use this lock if you are developing an application * which calls poll() or select() on libusb's file descriptors directly, * <b>and</b> may potentially be handling events from 2 threads simultaenously. * If you stick to libusb's event handling loop functions (e.g. * libusb_handle_events()) then you do not need to be concerned with this * locking. * * \param ctx the context to operate on, or NULL for the default context * \see \ref mtasync */API_EXPORTED void libusb_lock_event_waiters(libusb_context *ctx){	USBI_GET_CONTEXT(ctx);	pthread_mutex_lock(&ctx->event_waiters_lock);}/** \ingroup poll * Release the event waiters lock. * \param ctx the context to operate on, or NULL for the default context * \see \ref mtasync */API_EXPORTED void libusb_unlock_event_waiters(libusb_context *ctx){	USBI_GET_CONTEXT(ctx);	pthread_mutex_unlock(&ctx->event_waiters_lock);}/** \ingroup poll * Wait for another thread to signal completion of an event. Must be called * with the event waiters lock held, see libusb_lock_event_waiters(). * * This function will block until any of the following conditions are met: * -# The timeout expires * -# A transfer completes * -# A thread releases the event handling lock through libusb_unlock_events() * * Condition 1 is obvious. Condition 2 unblocks your thread <em>after</em> * the callback for the transfer has completed. Condition 3 is important * because it means that the thread that was previously handling events is no * longer doing so, so if any events are to complete, another thread needs to * step up and start event handling. * * This function releases the event waiters lock before putting your thread * to sleep, and reacquires the lock as it is being woken up. * * \param ctx the context to operate on, or NULL for the default context * \param tv maximum timeout for this blocking function. A NULL value * indicates unlimited timeout. * \returns 0 after a transfer completes or another thread stops event handling * \returns 1 if the timeout expired * \see \ref mtasync */API_EXPORTED int libusb_wait_for_event(libusb_context *ctx, struct timeval *tv){	struct timespec timeout;	int r;	USBI_GET_CONTEXT(ctx);	if (tv == NULL) {		pthread_cond_wait(&ctx->event_waiters_cond, &ctx->event_waiters_lock);		return 0;	}	r = clock_gettime(CLOCK_REALTIME, &timeout);	if (r < 0) {		usbi_err(ctx, "failed to read realtime clock, error %d", errno);		return LIBUSB_ERROR_OTHER;	}	timeout.tv_sec += tv->tv_sec;	timeout.tv_nsec += tv->tv_usec * 1000;	if (timeout.tv_nsec > 1000000000) {		timeout.tv_nsec -= 1000000000;		timeout.tv_sec++;	}	r = pthread_cond_timedwait(&ctx->event_waiters_cond,		&ctx->event_waiters_lock, &timeout);	return (r == ETIMEDOUT);}static void handle_timeout(struct usbi_transfer *itransfer){	struct libusb_transfer *transfer =		__USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);	int r;	itransfer->flags |= USBI_TRANSFER_TIMED_OUT;	r = libusb_cancel_transfer(transfer);	if (r < 0)		usbi_warn(TRANSFER_CTX(transfer),			"async cancel failed %d errno=%d", r, errno);}static int handle_timeouts(struct libusb_context *ctx){	struct timespec systime_ts;	struct timeval systime;	struct usbi_transfer *transfer;	int r = 0;	USBI_GET_CONTEXT(ctx);	pthread_mutex_lock(&ctx->flying_transfers_lock);	if (list_empty(&ctx->flying_transfers))		goto out;	/* get current time */	r = clock_gettime(CLOCK_MONOTONIC, &systime_ts);	if (r < 0)		goto out;	TIMESPEC_TO_TIMEVAL(&systime, &systime_ts);	/* iterate through flying transfers list, finding all transfers that	 * have expired timeouts */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人毛片老司机大片| 国产一区二区免费看| va亚洲va日韩不卡在线观看| 一区二区三区在线观看国产| 欧美一区二区视频在线观看2020 | 欧美影院一区二区三区| 经典三级视频一区| 亚洲高清免费视频| 亚洲三级免费观看| 国产欧美日韩视频一区二区| 4438成人网| 欧美午夜精品理论片a级按摩| 成人动漫一区二区三区| 国产一区二区三区免费观看| 亚洲一区二区高清| 国产精品久久久一本精品| 精品国产1区2区3区| 在线播放一区二区三区| 91麻豆福利精品推荐| 国产69精品久久777的优势| 久久国产精品无码网站| 日本一不卡视频| 亚洲一区二区三区四区在线观看| 国产精品成人午夜| 中文字幕不卡在线观看| 国产免费观看久久| 久久精品综合网| 久久午夜国产精品| 精品动漫一区二区三区在线观看| 3d动漫精品啪啪| 欧美精品亚洲一区二区在线播放| 欧美在线观看你懂的| 91高清视频在线| 欧美亚洲禁片免费| 日本韩国欧美一区二区三区| 色综合天天综合给合国产| 99久久国产免费看| 91丝袜国产在线播放| 成人高清在线视频| 波多野洁衣一区| 99精品久久久久久| 色综合亚洲欧洲| 欧美亚洲国产bt| 91.xcao| 欧美日韩午夜影院| 91麻豆精品国产91久久久更新时间| 欧美高清www午色夜在线视频| 欧美日韩国产大片| 欧美一卡二卡在线观看| 精品久久久久av影院| 久久综合精品国产一区二区三区| 久久伊人蜜桃av一区二区| 久久久亚洲精华液精华液精华液| 日本一区二区三区在线观看| √…a在线天堂一区| 伊人色综合久久天天人手人婷| 亚洲v中文字幕| 男人的天堂久久精品| 国产老女人精品毛片久久| 不卡的电影网站| 欧美怡红院视频| 精品久久久久久亚洲综合网| 国产精品乱码久久久久久| 亚洲欧美偷拍另类a∨色屁股| 午夜精品影院在线观看| 国内精品视频一区二区三区八戒| 高清不卡在线观看| 欧美手机在线视频| 精品电影一区二区三区| 自拍偷拍欧美激情| 午夜精品久久久久久不卡8050| 极品尤物av久久免费看| 99热99精品| 日韩视频国产视频| 国产精品久久夜| 午夜av一区二区三区| 国产一区二区三区四区五区入口| 91啪在线观看| 欧美电影精品一区二区| 亚洲欧洲成人av每日更新| 午夜国产不卡在线观看视频| 国产99久久久国产精品潘金网站| 在线免费观看日本一区| 久久品道一品道久久精品| 亚洲一二三四区不卡| 狠狠色丁香久久婷婷综合丁香| 91久久香蕉国产日韩欧美9色| 精品国产电影一区二区| 亚洲午夜免费电影| 成人综合在线视频| 日韩一本二本av| 亚洲欧美国产高清| 国产精品一级在线| 欧美丰满高潮xxxx喷水动漫| 亚洲国产精品t66y| 老司机精品视频在线| 日本精品视频一区二区| 久久久精品国产免费观看同学| 亚洲电影一区二区| 成人av网站免费观看| 日韩三级视频在线观看| 亚洲成在人线免费| 91麻豆蜜桃一区二区三区| 精品国产精品网麻豆系列| 午夜天堂影视香蕉久久| 一本大道久久a久久综合婷婷| 国产午夜一区二区三区| 日本欧美在线观看| 欧美三日本三级三级在线播放| 国产精品久久一级| 国产成人日日夜夜| 26uuu另类欧美亚洲曰本| 日韩中文字幕91| 欧美丝袜丝交足nylons图片| 亚洲男人电影天堂| 91香蕉视频黄| 中文字幕在线一区| 国产成人精品影视| 久久久国产精品麻豆| 久久精品国产免费| 日韩一区二区三区精品视频| 亚洲午夜久久久久| 色欧美88888久久久久久影院| 中文字幕国产一区二区| 国产99精品国产| 国产欧美一区二区三区在线看蜜臀| 捆绑紧缚一区二区三区视频| 日韩亚洲欧美高清| 日韩黄色免费网站| 欧美一三区三区四区免费在线看| 婷婷六月综合网| 7777精品伊人久久久大香线蕉的| 午夜电影网亚洲视频| 欧美另类z0zxhd电影| 性欧美大战久久久久久久久| 欧美日韩www| 蜜芽一区二区三区| 日韩一区二区三区在线观看 | 蜜桃精品视频在线观看| 91精品久久久久久久久99蜜臂| 日本少妇一区二区| 精品国产精品一区二区夜夜嗨| 国产乱码一区二区三区| 中文字幕国产一区| 99国产精品一区| 洋洋av久久久久久久一区| 欧美日韩国产另类不卡| 免费看黄色91| 国产婷婷色一区二区三区在线| 高清不卡在线观看| 亚洲欧美另类小说| 欧美精品久久99| 激情国产一区二区| 国产欧美日韩卡一| 91麻豆6部合集magnet| 天堂午夜影视日韩欧美一区二区| 日韩一区二区影院| 国产高清亚洲一区| 亚洲精品成人精品456| 精品视频一区二区不卡| 男人的j进女人的j一区| 久久精品亚洲麻豆av一区二区| 国产精品一二一区| 亚洲精品免费一二三区| 欧美日韩美女一区二区| 麻豆极品一区二区三区| 久久久久久久久久久电影| 波多野结衣中文一区| 一区二区三区在线影院| 欧美日韩一区国产| 天天色天天操综合| 色哟哟国产精品| 成人午夜激情视频| 亚洲乱码国产乱码精品精98午夜 | 婷婷成人综合网| 久久久久久夜精品精品免费| 91啪九色porn原创视频在线观看| 天堂va蜜桃一区二区三区| 中文字幕不卡一区| 制服丝袜一区二区三区| av电影在线观看不卡| 日本特黄久久久高潮| 最新不卡av在线| 91精品国产综合久久蜜臀| av一区二区三区黑人| 奇米色一区二区| 亚洲人快播电影网| 精品999在线播放| 欧美视频在线一区二区三区 | 亚洲午夜精品一区二区三区他趣| 精品理论电影在线| 欧美综合天天夜夜久久| 国产乱对白刺激视频不卡| 婷婷丁香久久五月婷婷| 最新日韩在线视频| 精品日韩99亚洲| 欧美日韩国产bt| 一本大道久久精品懂色aⅴ| 国产美女精品人人做人人爽| 日本午夜精品视频在线观看|