• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ schedule_task函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: note

static JSBool note(JSContext *cx, uintN argc, jsval *vp)
{
    struct note_data *note = malloc(sizeof(struct note_data));
    int time, duration;
    if (argc < 5) {
        JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "uuuu",
            &time, &note->pitch, &note->velocity, &duration);

        note->channel = 1;
    } else {
        JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "uuuuu",
                &time, &note->pitch, &note->velocity, &duration, &note->channel);
    }

    struct task *note_on  = task_create(time);
    struct task *note_off = task_create(time + duration);

    note_on->c_function  = flm_note_on;
    note_on->fn_data     = note;
    note_on->task_type  = C_FUNCTION;

    note_off->c_function = flm_note_off;
    note_off->fn_data    = note;
    note_off->task_type  = C_FUNCTION;

    schedule_task(flim->scheduler, note_on);
    schedule_task(flim->scheduler, note_off);

    return JS_TRUE;
}
开发者ID:mrdg,项目名称:flim,代码行数:30,代码来源:flim.c


示例2: schedule_periodic_task

Task_t* schedule_periodic_task(uint32_t period, void (*function)(), void* arg)
{
	period+=MIN_TASK_TIME_IN_FUTURE*(period<MIN_TASK_TIME_IN_FUTURE);	
	volatile Task_t* new_task = schedule_task(period, function, arg);
	new_task->period=period;
	return new_task;
}
开发者ID:shangma,项目名称:cu-droplet,代码行数:7,代码来源:scheduler.c


示例3: worker_start

/**
 * Work.
 *
 */
void
worker_start(worker_type* worker)
{
    ods_log_assert(worker);

    while (worker->need_to_exit == 0) {
        ods_log_debug("[worker[%i]]: report for duty", worker->thread_num);

        /* When no task available this call blocks and waits for event.
         * Then it will return NULL; */
        worker->task = schedule_pop_task(worker->engine->taskq);
        if (worker->task) {
            ods_log_debug("[worker[%i]] start working", worker->thread_num);
            worker_perform_task(worker);
            ods_log_debug("[worker[%i]] finished working", worker->thread_num);
            if (worker->task) {
                if (schedule_task(worker->engine->taskq, worker->task) !=
                    ODS_STATUS_OK)
                {
                    ods_log_error("[worker[%i]] unable to schedule task",
                        worker->thread_num);
                }
                worker->task = NULL;
            }
        }
    }
}
开发者ID:eest,项目名称:opendnssec,代码行数:31,代码来源:worker.c


示例4: ide_detach

static void ide_detach(dev_link_t *link)
{
    dev_link_t **linkp;
    ide_info_t *info = link->priv;
    int ret;

    DEBUG(0, "ide_detach(0x%p)\n", link);
    
    /* Locate device structure */
    for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
	if (*linkp == link) break;
    if (*linkp == NULL)
	return;

    if (link->state & DEV_CONFIG) {
	schedule_task(&info->rel_task);
	flush_scheduled_tasks();
    }
    
    if (link->handle) {
	ret = CardServices(DeregisterClient, link->handle);
	if (ret != CS_SUCCESS)
	    cs_error(link->handle, DeregisterClient, ret);
    }
    
    /* Unlink, free device structure */
    *linkp = link->next;
    kfree(info);
    
} /* ide_detach */
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:30,代码来源:ide-cs.c


示例5: ide_event

int ide_event(event_t event, int priority,
	      event_callback_args_t *args)
{
    dev_link_t *link = args->client_data;
    ide_info_t *info = link->priv;

    DEBUG(1, "ide_event(0x%06x)\n", event);
    
    switch (event) {
    case CS_EVENT_CARD_REMOVAL:
	link->state &= ~DEV_PRESENT;
	if (link->state & DEV_CONFIG)
	    schedule_task(&info->rel_task);
	break;
    case CS_EVENT_CARD_INSERTION:
	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
	ide_config(link);
	break;
    case CS_EVENT_PM_SUSPEND:
	link->state |= DEV_SUSPEND;
	/* Fall through... */
    case CS_EVENT_RESET_PHYSICAL:
	if (link->state & DEV_CONFIG)
	    CardServices(ReleaseConfiguration, link->handle);
	break;
    case CS_EVENT_PM_RESUME:
	link->state &= ~DEV_SUSPEND;
	/* Fall through... */
    case CS_EVENT_CARD_RESET:
	if (DEV_OK(link))
	    CardServices(RequestConfiguration, link->handle, &link->conf);
	break;
    }
    return 0;
} /* ide_event */
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:35,代码来源:ide-cs.c


示例6: au1000_pcmcia_poll_event

static void au1000_pcmcia_poll_event(u32 dummy)
{
	poll_timer.function = au1000_pcmcia_poll_event;
	poll_timer.expires = jiffies + AU1000_PCMCIA_POLL_PERIOD;
	add_timer(&poll_timer);
	schedule_task(&au1000_pcmcia_task);
}
开发者ID:froggatt,项目名称:edimax-br-6528n,代码行数:7,代码来源:au1000_generic.c


示例7: ieee80211_wx_set_scan

int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info *a,
			     union iwreq_data *wrqu, char *b)
{
	int ret = 0;

	down(&ieee->wx_sem);

	if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)){
		ret = -1;
		goto out;
	}

	if ( ieee->state == IEEE80211_LINKED){
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
		queue_work(ieee->wq, &ieee->wx_sync_scan_wq);
#else
		schedule_task(&ieee->wx_sync_scan_wq);
#endif
		/* intentionally forget to up sem */
		return 0;
	}

out:
	up(&ieee->wx_sem);
	return ret;
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:26,代码来源:ieee80211_softmac_wx.c


示例8: TAPI_timer_call_back

/****************************************************************************
Description :
   Helper function to get a periodical timer
Arguments   :
   arg   - pointer to corresponding timer ID
Return      :
   NONE
****************************************************************************/
IFX_LOCAL IFX_void_t TAPI_timer_call_back (IFX_int32_t arg)
{
   Timer_ID Timer = (Timer_ID) arg;
   /* do the operation in process context,
      not in interrupt context */
   schedule_task (&(Timer->timerTask));
}
开发者ID:pekiZG,项目名称:sx76x-openwrt-danube,代码行数:15,代码来源:drv_tapi_linux.c


示例9: APU_DECLARE

APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me,
                                                   apr_thread_start_t func,
                                                   void *param,
                                                   apr_interval_time_t time,
                                                   void *owner)
{
    return schedule_task(me, func, param, owner, time);
}
开发者ID:accre,项目名称:lstore-apr-util-accre,代码行数:8,代码来源:apr_thread_pool.c


示例10: pxa_pcmcia_poll_event

/* pxa_pcmcia_poll_event()
 * ^^^^^^^^^^^^^^^^^^^^^^^^^^
 * Let's poll for events in addition to IRQs since IRQ only is unreliable...
 */
static void pxa_pcmcia_poll_event(unsigned long dummy)
{
  DEBUG(3, "%s(): polling for events\n", __FUNCTION__);
  poll_timer.function = pxa_pcmcia_poll_event;
  poll_timer.expires = jiffies + PXA_PCMCIA_POLL_PERIOD;
  add_timer(&poll_timer);
  schedule_task(&pxa_pcmcia_task);
}
开发者ID:hugh712,项目名称:Jollen,代码行数:12,代码来源:pxa.c


示例11: schedule_task

		TimerWorker::schedule_repeated(timespec run_time, long interval, task_func_t task_func, void* task_arg)
		{
			Task task;
			task.next_run_time = run_time;
			task.interval = interval;
			task.task_func_routine = task_func;
			task.arg = arg;
			return schedule_task(task);
		}
开发者ID:smdown,项目名称:timer_worker,代码行数:9,代码来源:timer_worker.cpp


示例12: start_test

void start_test()
{
	int i;

	for (i = 0; i < GPIO_NB; ++i)
		configure_gpio_output(&gpio_to_toggle[i], (enum gpio_bank) index_to_mapping[i][0], index_to_mapping[i][1], GPIO_PUSH_PULL);

	schedule_task(now, (task_handler) toggle_gpio, 0, 0, 0, 0);
}
开发者ID:tecul,项目名称:hclock_firmware,代码行数:9,代码来源:test.c


示例13: toggle_gpio

void toggle_gpio(int index)
{
	struct gpio_out *current = &gpio_to_toggle[index].out;
	struct gpio_out *next = &gpio_to_toggle[(index + 1) % GPIO_NB].out;

	current->clear(current);
	next->set(next);
	schedule_task(1 * ms, (task_handler) toggle_gpio, (index + 1) % GPIO_NB, 0, 0, 0);
}
开发者ID:tecul,项目名称:hclock_firmware,代码行数:9,代码来源:test.c


示例14: jiq_print_tq

/*
 * Call jiq_print from a task queue
 */
void jiq_print_tq(void *ptr)
{
    if (jiq_print (ptr)) {
        struct clientdata *data = (struct clientdata *)ptr;
        if (data->queue == SCHEDULER_QUEUE)
	    schedule_task(&jiq_task);
        else if (data->queue)
            queue_task(&jiq_task, data->queue);
        if (data->queue == &tq_immediate)
            mark_bh(IMMEDIATE_BH); /* this one needs to be marked */
    }
}
开发者ID:crond,项目名称:dd,代码行数:15,代码来源:jiq.c


示例15: gen_rtc_timer

static void gen_rtc_timer(unsigned long data)
{
	lostint = get_rtc_ss() - oldsecs ;
	if (lostint<0) 
		lostint = 60 - lostint;
	if (time_after(jiffies, tt_exp))
		printk(KERN_INFO "genrtc: timer task delayed by %ld jiffies\n",
		       jiffies-tt_exp);
	ttask_active=0;
	stask_active=1;
	if ((schedule_task(&genrtc_task) == 0))
		stask_active = 0;
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:13,代码来源:genrtc.c


示例16: ether00_mem_update

void ether00_mem_update(void* dev_id)
{
	struct net_device* dev=dev_id;
	struct net_priv* priv=dev->priv;
	struct rx_blist_ent* blist_ent_ptr;
	unsigned long flags;
        int enable_rx = 0;

	priv->tq_memupdate.sync=0;
	priv->memupdate_scheduled=0;

	/* Fill in any missing buffers from the received queue */
	blist_ent_ptr=priv->rx_blist_vp;
	while(blist_ent_ptr<(priv->rx_blist_vp+RX_NUM_BUFF)){
		spin_lock_irqsave(&priv->dma_lock,flags);
		/* fd.FDSystem of 0 indicates we failed to allocate the buffer in the ISR */
		if(!blist_ent_ptr->fd.FDSystem){
			struct sk_buff *skb;
			skb=dev_alloc_skb(PKT_BUF_SZ);
			blist_ent_ptr->fd.FDSystem=(unsigned int)skb;
			if(skb){
				setup_blist_entry(skb,blist_ent_ptr);
                                enable_rx = 1;
			}
			else
			{
                                /*
                                 * reschedule the clean up, since we
                                 * didn't patch up all the buffers
                                 */

	                         if(!priv->memupdate_scheduled){
				   schedule_task(&priv->tq_memupdate);
				   priv->memupdate_scheduled=1;
				 }
		                 spin_unlock_irqrestore(&priv->dma_lock,flags);
				 break;
			}
		}
		spin_unlock_irqrestore(&priv->dma_lock,flags);
		blist_ent_ptr++;
	}

	if(enable_rx){
	  if (!priv->rx_disabled){
	        priv->rx_disabled = 0;
		writel(ETHER_RX_CTL_RXEN_MSK,ETHER_RX_CTL(dev->base_addr));
	  }
	}
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:50,代码来源:ether00.c


示例17: monitor_schedule_bh

/**
 * monitor_schedule_bh -
 */
void monitor_schedule_bh(void) 
{
    //printk(KERN_DEBUG "monitor_schedule_bh: schedule bh to %s\n", msg);

    if (monitor.monitor_bh.sync) {
        return;
    }

    MOD_INC_USE_COUNT;
    if (!schedule_task(&monitor.monitor_bh)) {
        printk(KERN_DEBUG "monitor_schedule_bh: failed\n");
        MOD_DEC_USE_COUNT;
    }
}
开发者ID:robacklin,项目名称:uclinux-linux,代码行数:17,代码来源:usbd-monitor.c


示例18: hotplug_schedule_bh

/**
 * hotplug_schedule_bh -
 */
void hotplug_schedule_bh(void) 
{
    printk(KERN_DEBUG "hotplug_schedule_bh: schedule bh\n");

    if (monitor.hotplug_bh.sync) {
        return;
    }

    MOD_INC_USE_COUNT;
    if (!schedule_task(&monitor.hotplug_bh)) {
        printk(KERN_DEBUG "monitor_schedule_bh: failed\n");
        MOD_DEC_USE_COUNT;
    }
}
开发者ID:robacklin,项目名称:uclinux-linux,代码行数:17,代码来源:usbd-monitor.c


示例19: xmbrs_modem_change

/*
 *	Change of state on a DCD line.
 */
void xmbrs_modem_change(struct xmb_serial *info, int dcd)
{
	if (info->count == 0)
		return;

	if (info->flags & ASYNC_CHECK_CD) {
		if (dcd) {
			wake_up_interruptible(&info->open_wait);
		} else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
		    (info->flags & ASYNC_CALLOUT_NOHUP))) {
			schedule_task(&info->tqueue_hangup);
		}
	}
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:17,代码来源:xmbserial.c


示例20: enf_schedule_task

static void
enf_schedule_task(int sockfd, engine_type* engine, task_type *task, const char *what)
{
	/* schedule task */
	if (!task) {
		ods_log_crit("[%s] failed to create %s task", module_str, what);
	} else {
		ods_status status = schedule_task(engine->taskq, task);
		if (status != ODS_STATUS_OK) {
			ods_log_crit("[%s] failed to create %s task", module_str, what);
			client_printf(sockfd, "Unable to schedule %s task.\n", what);
		} else {
			client_printf(sockfd, "Scheduled %s task.\n", what);
		}
	}
}
开发者ID:eest,项目名称:opendnssec,代码行数:16,代码来源:enforce_task.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ schedule_timeout函数代码示例发布时间:2022-05-30
下一篇:
C++ schedule_selector函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap