当前位置: 首页>>代码示例>>C++>>正文


C++ schedule_task函数代码示例

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


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


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