您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ unlock_hrtimer_base函数代码示例

51自学网 2021-06-03 09:10:56
  C++
这篇教程C++ unlock_hrtimer_base函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中unlock_hrtimer_base函数的典型用法代码示例。如果您正苦于以下问题:C++ unlock_hrtimer_base函数的具体用法?C++ unlock_hrtimer_base怎么用?C++ unlock_hrtimer_base使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了unlock_hrtimer_base函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: hrtimer_try_to_cancel

/** * hrtimer_try_to_cancel - try to deactivate a timer * @timer:	hrtimer to stop * * Returns: *  0 when the timer was not active *  1 when the timer was active * -1 when the timer is currently excuting the callback function and *    cannot be stopped */int hrtimer_try_to_cancel(struct hrtimer *timer){	struct hrtimer_clock_base *base;	unsigned long flags;	int ret = -1;	/*	 * Check lockless first. If the timer is not active (neither	 * enqueued nor running the callback, nothing to do here.  The	 * base lock does not serialize against a concurrent enqueue,	 * so we can avoid taking it.	 */	if (!hrtimer_active(timer))		return 0;	base = lock_hrtimer_base(timer, &flags);	if (!hrtimer_callback_running(timer))		ret = remove_hrtimer(timer, base, false);	unlock_hrtimer_base(timer, &flags);	return ret;}
开发者ID:AK101111,项目名称:linux,代码行数:35,


示例2: hrtimer_get_remaining

/** * hrtimer_get_remaining - get remaining time for the timer * @timer:	the timer to read */ktime_t hrtimer_get_remaining(const struct hrtimer *timer){	unsigned long flags;	ktime_t rem;	lock_hrtimer_base(timer, &flags);	rem = hrtimer_expires_remaining(timer);	unlock_hrtimer_base(timer, &flags);	return rem;}
开发者ID:RolanDroid,项目名称:lge_MonsterKernel-lproj,代码行数:15,


示例3: hrtimer_start

/** * hrtimer_start - (re)start an relative timer on the current CPU * @timer:	the timer to be added * @tim:	expiry time * @mode:	expiry mode: absolute (HRTIMER_ABS) or relative (HRTIMER_REL) * * Returns: *  0 on success *  1 when the timer was active */inthrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int ret, raise;	base = lock_hrtimer_base(timer, &flags);	/* Remove an active timer from the queue: */	ret = remove_hrtimer(timer, base);	/* Switch the timer base, if necessary: */	new_base = switch_hrtimer_base(timer, base);	if (mode == HRTIMER_MODE_REL) {		tim = ktime_add_safe(tim, new_base->get_time());		/*		 * CONFIG_TIME_LOW_RES is a temporary way for architectures		 * to signal that they simply return xtime in		 * do_gettimeoffset(). In this case we want to round up by		 * resolution when starting a relative timer, to avoid short		 * timeouts. This will go away with the GTOD framework.		 */#ifdef CONFIG_TIME_LOW_RES		tim = ktime_add_safe(tim, base->resolution);#endif	}	timer->expires = tim;	timer_stats_hrtimer_set_start_info(timer);	/*	 * Only allow reprogramming if the new base is on this CPU.	 * (it might still be on another CPU if the timer was pending)	 */	enqueue_hrtimer(timer, new_base,			new_base->cpu_base == &__get_cpu_var(hrtimer_bases));	/*	 * The timer may be expired and moved to the cb_pending	 * list. We can not raise the softirq with base lock held due	 * to a possible deadlock with runqueue lock.	 */	raise = timer->state == HRTIMER_STATE_PENDING;	unlock_hrtimer_base(timer, &flags);	if (raise)		hrtimer_raise_softirq();	return ret;}
开发者ID:mikuhatsune001,项目名称:linux-2.6,代码行数:64,


示例4: hrtimer_get_remaining

/** * hrtimer_get_remaining - get remaining time for the timer * @timer:	the timer to read */ktime_t hrtimer_get_remaining(const struct hrtimer *timer){	struct hrtimer_clock_base *base;	unsigned long flags;	ktime_t rem;	base = lock_hrtimer_base(timer, &flags);	rem = ktime_sub(timer->expires, base->get_time());	unlock_hrtimer_base(timer, &flags);	return rem;}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:16,


示例5: hrtimer_start

/** * hrtimer_start - (re)start an relative timer on the current CPU * @timer:	the timer to be added * @tim:	expiry time * @mode:	expiry mode: absolute (HRTIMER_ABS) or relative (HRTIMER_REL) * * Returns: *  0 on success *  1 when the timer was active */inthrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int ret;	base = lock_hrtimer_base(timer, &flags);	/* Remove an active timer from the queue: */	ret = remove_hrtimer(timer, base);	/* Switch the timer base, if necessary: */	new_base = switch_hrtimer_base(timer, base);	if (mode == HRTIMER_MODE_REL) {		tim = ktime_add(tim, new_base->get_time());		/*		 * CONFIG_TIME_LOW_RES is a temporary way for architectures		 * to signal that they simply return xtime in		 * do_gettimeoffset(). In this case we want to round up by		 * resolution when starting a relative timer, to avoid short		 * timeouts. This will go away with the GTOD framework.		 */#ifdef CONFIG_TIME_LOW_RES		tim = ktime_add(tim, base->resolution);#endif		/*		 * Careful here: User space might have asked for a		 * very long sleep, so the add above might result in a		 * negative number, which enqueues the timer in front		 * of the queue.		 */		if (tim.tv64 < 0)			tim.tv64 = KTIME_MAX;	}	timer->expires = tim;	timer_stats_hrtimer_set_start_info(timer);	/*	 * Only allow reprogramming if the new base is on this CPU.	 * (it might still be on another CPU if the timer was pending)	 */	enqueue_hrtimer(timer, new_base,			new_base->cpu_base == &__get_cpu_var(hrtimer_bases));	unlock_hrtimer_base(timer, &flags);	return ret;}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:61,


示例6: __hrtimer_get_remaining

/** * hrtimer_get_remaining - get remaining time for the timer * @timer:	the timer to read * @adjust:	adjust relative timers when CONFIG_TIME_LOW_RES=y */ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust){	unsigned long flags;	ktime_t rem;	lock_hrtimer_base(timer, &flags);	if (IS_ENABLED(CONFIG_TIME_LOW_RES) && adjust)		rem = hrtimer_expires_remaining_adjusted(timer);	else		rem = hrtimer_expires_remaining(timer);	unlock_hrtimer_base(timer, &flags);	return rem;}
开发者ID:AK101111,项目名称:linux,代码行数:19,


示例7: hrtimer_start_range_ns

/** * hrtimer_start_range_ns - (re)start an hrtimer on the current CPU * @timer:	the timer to be added * @tim:	expiry time * @delta_ns:	"slack" range for the timer * @mode:	expiry mode: absolute (HRTIMER_MODE_ABS) or *		relative (HRTIMER_MODE_REL) */void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,			    unsigned long delta_ns, const enum hrtimer_mode mode){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int leftmost;	base = lock_hrtimer_base(timer, &flags);	/* Remove an active timer from the queue: */	remove_hrtimer(timer, base, true);	if (mode & HRTIMER_MODE_REL) {		tim = ktime_add_safe(tim, base->get_time());		/*		 * CONFIG_TIME_LOW_RES is a temporary way for architectures		 * to signal that they simply return xtime in		 * do_gettimeoffset(). In this case we want to round up by		 * resolution when starting a relative timer, to avoid short		 * timeouts. This will go away with the GTOD framework.		 */#ifdef CONFIG_TIME_LOW_RES		tim = ktime_add_safe(tim, ktime_set(0, hrtimer_resolution));#endif	}	hrtimer_set_expires_range_ns(timer, tim, delta_ns);	/* Switch the timer base, if necessary: */	new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);	timer_stats_hrtimer_set_start_info(timer);	leftmost = enqueue_hrtimer(timer, new_base);	if (!leftmost)		goto unlock;	if (!hrtimer_is_hres_active(timer)) {		/*		 * Kick to reschedule the next tick to handle the new timer		 * on dynticks target.		 */		if (new_base->cpu_base->nohz_active)			wake_up_nohz_cpu(new_base->cpu_base->cpu);	} else {		hrtimer_reprogram(timer, new_base);	}unlock:	unlock_hrtimer_base(timer, &flags);}
开发者ID:DenisLug,项目名称:mptcp,代码行数:58,


示例8: hrtimer_try_to_cancel

/** * hrtimer_try_to_cancel - try to deactivate a timer * @timer:	hrtimer to stop * * Returns: *  0 when the timer was not active *  1 when the timer was active * -1 when the timer is currently excuting the callback function and *    cannot be stopped */int hrtimer_try_to_cancel(struct hrtimer *timer){	struct hrtimer_clock_base *base;	unsigned long flags;	int ret = -1;	base = lock_hrtimer_base(timer, &flags);	if (!hrtimer_callback_running(timer))		ret = remove_hrtimer(timer, base);	unlock_hrtimer_base(timer, &flags);	return ret;}
开发者ID:RolanDroid,项目名称:lge_MonsterKernel-lproj,代码行数:26,


示例9: __hrtimer_start_range_ns

int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,		unsigned long delta_ns, const enum hrtimer_mode mode,		int wakeup){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int ret, leftmost;	base = lock_hrtimer_base(timer, &flags);		ret = remove_hrtimer(timer, base);		new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);	if (mode & HRTIMER_MODE_REL) {		tim = ktime_add_safe(tim, new_base->get_time());#ifdef CONFIG_TIME_LOW_RES		tim = ktime_add_safe(tim, base->resolution);#endif	}	hrtimer_set_expires_range_ns(timer, tim, delta_ns);	timer_stats_hrtimer_set_start_info(timer);	leftmost = enqueue_hrtimer(timer, new_base);	if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases)		&& hrtimer_enqueue_reprogram(timer, new_base)) {		if (wakeup) {			raw_spin_unlock(&new_base->cpu_base->lock);			raise_softirq_irqoff(HRTIMER_SOFTIRQ);			local_irq_restore(flags);			return ret;		} else {			__raise_softirq_irqoff(HRTIMER_SOFTIRQ);		}	}	unlock_hrtimer_base(timer, &flags);	return ret;}
开发者ID:ivanmeler,项目名称:android_kernel_htc_g3u,代码行数:45,


示例10: hrtimer_start_range_ns

/** * hrtimer_start_range_ns - (re)start an hrtimer on the current CPU * @timer:	the timer to be added * @tim:	expiry time * @delta_ns:	"slack" range for the timer * @mode:	expiry mode: absolute (HRTIMER_MODE_ABS) or *		relative (HRTIMER_MODE_REL) */void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,			    u64 delta_ns, const enum hrtimer_mode mode){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int leftmost;	base = lock_hrtimer_base(timer, &flags);	/* Remove an active timer from the queue: */	remove_hrtimer(timer, base, true);	if (mode & HRTIMER_MODE_REL)		tim = ktime_add_safe(tim, base->get_time());	tim = hrtimer_update_lowres(timer, tim, mode);	hrtimer_set_expires_range_ns(timer, tim, delta_ns);	/* Switch the timer base, if necessary: */	new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);	timer_stats_hrtimer_set_start_info(timer);	leftmost = enqueue_hrtimer(timer, new_base);	if (!leftmost)		goto unlock;	if (!hrtimer_is_hres_active(timer)) {		/*		 * Kick to reschedule the next tick to handle the new timer		 * on dynticks target.		 */		if (new_base->cpu_base->nohz_active)			wake_up_nohz_cpu(new_base->cpu_base->cpu);	} else {		hrtimer_reprogram(timer, new_base);	}unlock:	unlock_hrtimer_base(timer, &flags);}
开发者ID:AK101111,项目名称:linux,代码行数:49,


示例11: __hrtimer_start_range_ns

int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,		unsigned long delta_ns, const enum hrtimer_mode mode,		int wakeup){	struct hrtimer_clock_base *base, *new_base;	unsigned long flags;	int ret, leftmost;    /*add MTK debug log for ALPS01804694*/    if(timer->function == NULL) {		pr_alert("add hrtimer but do nothing");		dump_stack();    }		base = lock_hrtimer_base(timer, &flags);	/* Remove an active timer from the queue: */	ret = remove_hrtimer(timer, base);	if (mode & HRTIMER_MODE_REL) {		tim = ktime_add_safe(tim, base->get_time());		/*		 * CONFIG_TIME_LOW_RES is a temporary way for architectures		 * to signal that they simply return xtime in		 * do_gettimeoffset(). In this case we want to round up by		 * resolution when starting a relative timer, to avoid short		 * timeouts. This will go away with the GTOD framework.		 */#ifdef CONFIG_TIME_LOW_RES		tim = ktime_add_safe(tim, base->resolution);#endif	}	hrtimer_set_expires_range_ns(timer, tim, delta_ns);	/* Switch the timer base, if necessary: */	new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);	timer_stats_hrtimer_set_start_info(timer);	leftmost = enqueue_hrtimer(timer, new_base);	/*	 * Only allow reprogramming if the new base is on this CPU.	 * (it might still be on another CPU if the timer was pending)	 *	 * XXX send_remote_softirq() ?	 */	if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases)		&& hrtimer_enqueue_reprogram(timer, new_base)) {		if (wakeup) {			/*			 * We need to drop cpu_base->lock to avoid a			 * lock ordering issue vs. rq->lock.			 */			raw_spin_unlock(&new_base->cpu_base->lock);			raise_softirq_irqoff(HRTIMER_SOFTIRQ);			local_irq_restore(flags);			return ret;		} else {			__raise_softirq_irqoff(HRTIMER_SOFTIRQ);		}	}	unlock_hrtimer_base(timer, &flags);	return ret;}
开发者ID:tiltkoko,项目名称:android_kernel_elephone_p8000,代码行数:67,



注:本文中的unlock_hrtimer_base函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ unlock_mutex函数代码示例
C++ unlock_fb_info函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。