这篇教程C++ unlock_timer函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中unlock_timer函数的典型用法代码示例。如果您正苦于以下问题:C++ unlock_timer函数的具体用法?C++ unlock_timer怎么用?C++ unlock_timer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了unlock_timer函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: itimer_delete/* * return timer owned by the process, used by exit_itimers */static void itimer_delete(struct k_itimer *timer){ unsigned long flags;retry_delete: spin_lock_irqsave(&timer->it_lock, flags); /* On RT we can race with a deletion */ if (!timer->it_signal) { unlock_timer(timer, flags); return; } if (timer_delete_hook(timer) == TIMER_RETRY) { rcu_read_lock(); unlock_timer(timer, flags); timer_wait_for_callback(clockid_to_kclock(timer->it_clock), timer); rcu_read_unlock(); goto retry_delete; } list_del(&timer->list); /* * This keeps any tasks waiting on the spin lock from thinking * they got something (see the lock code above). */ timer->it_signal = NULL; unlock_timer(timer, flags); release_posix_timer(timer, IT_ID_SET);}
开发者ID:garyvan,项目名称:openwrt-1.6,代码行数:34,
示例2: SYSCALL_DEFINE1/* Delete a POSIX.1b interval timer. */SYSCALL_DEFINE1(timer_delete, timer_t, timer_id){ struct k_itimer *timer; unsigned long flags;retry_delete: timer = lock_timer(timer_id, &flags); if (!timer) return -EINVAL; rcu_read_lock(); if (timer_delete_hook(timer) == TIMER_RETRY) { unlock_timer(timer, flags); timer_wait_for_callback(clockid_to_kclock(timer->it_clock), timer); rcu_read_unlock(); goto retry_delete; } rcu_read_unlock(); spin_lock(¤t->sighand->siglock); list_del(&timer->list); spin_unlock(¤t->sighand->siglock); /* * This keeps any tasks waiting on the spin lock from thinking * they got something (see the lock code above). */ timer->it_signal = NULL; unlock_timer(timer, flags); release_posix_timer(timer, IT_ID_SET); return 0;}
开发者ID:garyvan,项目名称:openwrt-1.6,代码行数:34,
示例3: remove_timer/***************************************************************************** * remove_timer * ****************************************************************************/static void remove_timer(int id){ /* removes a timer from the timer list */ struct ddekit_timer_s *l,*m; lock_timer(); for (l = &list; l && l->next && l->next->id!=id; l = l->next ) ; if (l && l->next) { m = l->next; DDEBUG_MSG_VERBOSE( "deleting timer at for tick: %d fn: %p, (now: %d)/n", m->exp, m->fn, jiffies); l->next = m->next; DDEBUG_MSG_TIMER(m); ddekit_simple_free(m); } unlock_timer();}
开发者ID:AgamAgarwal,项目名称:minix,代码行数:28,
示例4: _ddekit_timer_update/***************************************************************************** * _ddekit_timer_update * ****************************************************************************/void _ddekit_timer_update(){ lock_timer(); static myclock_t next_timout; if(list.next) { if(!_ddekit_timer_pending || list.next->exp < next_timout) { unsigned to = list.next->exp - jiffies; _ddekit_timer_pending = 1; if (list.next->exp <= jiffies) { DDEBUG_MSG_WARN("Timeout lies in past to %d, now: %d", list.next->exp, jiffies); to = 1; } sys_setalarm(to, 0 /* REL */); DDEBUG_MSG_VERBOSE("requesting alarm for clock tick %d , now %d", list.next->exp, jiffies); } next_timout = list.next->exp; } unlock_timer(); }
开发者ID:AgamAgarwal,项目名称:minix,代码行数:31,
示例5: insert_timer/***************************************************************************** * insert_timer * ****************************************************************************/static int insert_timer(struct ddekit_timer_s *t){ /* inserts a timer to the timer list */ int ret; lock_timer(); struct ddekit_timer_s *l; for (l = &list; l->next && l->next->exp <= t->exp; l = l->next) { } t->next = l->next; l->next = t; t->id = ret = _id; _id++; if (_id==0) { DDEBUG_MSG_WARN("Timer ID overflow..."); } DDEBUG_MSG_TIMER(t); unlock_timer(); return ret;}
开发者ID:AgamAgarwal,项目名称:minix,代码行数:33,
示例6: ddekit_timer_pending/***************************************************************************** * ddekit_timer_pending * ****************************************************************************/int ddekit_timer_pending(int timer){ int ret=0; struct ddekit_timer_s *t; lock_timer(); for (t=list.next; t; t = t->next) { if (t->id==timer) { ret = 1; } } unlock_timer(); return ret;}
开发者ID:AgamAgarwal,项目名称:minix,代码行数:17,
示例7: SYSCALL_DEFINE4/* Set a POSIX.1b interval timer */SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, const struct itimerspec __user *, new_setting, struct itimerspec __user *, old_setting){ struct k_itimer *timr; struct itimerspec new_spec, old_spec; int error = 0; unsigned long flag; struct itimerspec *rtn = old_setting ? &old_spec : NULL; struct k_clock *kc; if (!new_setting) return -EINVAL; if (copy_from_user(&new_spec, new_setting, sizeof (new_spec))) return -EFAULT; if (!timespec_valid(&new_spec.it_interval) || !timespec_valid(&new_spec.it_value)) return -EINVAL;retry: timr = lock_timer(timer_id, &flag); if (!timr) return -EINVAL; rcu_read_lock(); kc = clockid_to_kclock(timr->it_clock); if (WARN_ON_ONCE(!kc || !kc->timer_set)) error = -EINVAL; else error = kc->timer_set(timr, flags, &new_spec, rtn); unlock_timer(timr, flag); if (error == TIMER_RETRY) { timer_wait_for_callback(kc, timr); rtn = NULL; // We already got the old time... rcu_read_unlock(); goto retry; } rcu_read_unlock(); if (old_setting && !error && copy_to_user(old_setting, &old_spec, sizeof (old_spec))) error = -EFAULT; return error;}
开发者ID:garyvan,项目名称:openwrt-1.6,代码行数:48,
示例8: get_next/***************************************************************************** * get_next * ****************************************************************************/static struct ddekit_timer_s * get_next( myclock_t exp ){ /* * this one get the next timer, which's timeout expired, * returns NULL if no timer is pending */ struct ddekit_timer_s * ret = 0; lock_timer(); if (list.next) { if (list.next->exp <= exp) { ret = list.next; list.next = ret->next; } } unlock_timer(); return ret;}
开发者ID:AgamAgarwal,项目名称:minix,代码行数:22,
示例9: SYSCALL_DEFINE2/* Get the time remaining on a POSIX.1b interval timer. */SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, struct itimerspec __user *, setting){ struct k_itimer *timr; struct itimerspec cur_setting; unsigned long flags; timr = lock_timer(timer_id, &flags); if (!timr) return -EINVAL; CLOCK_DISPATCH(timr->it_clock, timer_get, (timr, &cur_setting)); unlock_timer(timr, flags); if (copy_to_user(setting, &cur_setting, sizeof (cur_setting))) return -EFAULT; return 0;}
开发者ID:AvengerMoJo,项目名称:apc-8750,代码行数:21,
注:本文中的unlock_timer函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ unlock_unit函数代码示例 C++ unlock_task_sighand函数代码示例 |