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


C++ queue_work_on函数代码示例

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


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

示例1: dt2w_input_event

static void dt2w_input_event(struct input_handle *handle, unsigned int type,
				unsigned int code, int value)
{
	if ((!scr_suspended) || (!dt2w_switch))
		return;

	/* You can debug here with 'adb shell getevent -l' command. */
	switch(code) {
		case ABS_MT_SLOT:
			doubletap2wake_reset();
			break;

		case ABS_MT_TRACKING_ID:
			if (value == 0xffffffff)
				is_touching = false;
			break;

		case ABS_MT_POSITION_X:
			touch_x = value;
			queue_work_on(0, dt2w_input_wq, &dt2w_input_work);
			break;

		case ABS_MT_POSITION_Y:
			touch_y = value;
			queue_work_on(0, dt2w_input_wq, &dt2w_input_work);
			break;

		default:
			break;
	}
}
开发者ID:TheTypoMaster,项目名称:e980-zeKrnl,代码行数:31,代码来源:doubletap2wake.c

示例2: sdio_mux_notify

static void sdio_mux_notify(void *_dev, unsigned event)
{
	DBG("%s: event %d notified\n", __func__, event);

	/* write avail may not be enouogh for a packet, but should be fine */
	if ((event == SDIO_EVENT_DATA_WRITE_AVAIL) &&
	    sdio_write_avail(sdio_mux_ch))
		queue_work_on(0, sdio_mux_workqueue, &work_sdio_mux_write);

	if ((event == SDIO_EVENT_DATA_READ_AVAIL) &&
	    sdio_read_avail(sdio_mux_ch))
		queue_work_on(0, sdio_mux_workqueue, &work_sdio_mux_read);
}
开发者ID:abematthew,项目名称:SGSII_Kernel,代码行数:13,代码来源:sdio_dmux.c

示例3: wg_input_event

static void wg_input_event(struct input_handle *handle, unsigned int type,
				unsigned int code, int value)
{

	if (scr_suspended() && code == ABS_MT_POSITION_X) {
		value -= 5000;
	}

#if WG_DEBUG
	pr_info("wg: code: %s|%u, val: %i\n",
		((code==ABS_MT_POSITION_X) ? "X" :
		(code==ABS_MT_POSITION_Y) ? "Y" :
		(code==ABS_MT_TRACKING_ID) ? "ID" :
		"undef"), code, value);
#endif
	if (code == ABS_MT_SLOT) {
		sweep2wake_reset();
		doubletap2wake_reset();
		return;
	}

	if (code == ABS_MT_TRACKING_ID && value == -1) {
		sweep2wake_reset();
		touch_cnt = true;
		queue_work_on(0, dt2w_input_wq, &dt2w_input_work);
		return;
	}

	if (code == ABS_MT_POSITION_X) {
		touch_x = value;
		touch_x_called = true;
	}

	if (code == ABS_MT_POSITION_Y) {
		touch_y = value;
		touch_y_called = true;
	}

	if (touch_x_called && touch_y_called) {
		touch_x_called = false;
		touch_y_called = false;
		queue_work_on(0, s2w_input_wq, &s2w_input_work);
	} else if (!scr_suspended() && touch_x_called && !touch_y_called) {
		touch_x_called = false;
		touch_y_called = false;
		queue_work_on(0, s2w_input_wq, &s2w_input_work);
	}
}
开发者ID:chrisc93,项目名称:android_kernel_bullhead,代码行数:48,代码来源:wake_gestures.c

示例4: cpu_usage_store

ssize_t cpu_usage_store(struct kobject *kobj, struct kobj_attribute *attr,
		const char *buf, size_t n)
{
	struct workqueue_struct	*workqueue;
	struct work_struct *work;
	char cmd[20];
	int usage = 0;
	int cpu;

	sscanf(buf, "%s %d", cmd, &usage);

	if((!strncmp(cmd, "start", strlen("start")))) {
		PM_DBG("get cmd start\n");
		cpu_usage_run = 1;
		
		cpu_usage_percent = (ARM_MODE_TIMER_MSEC * usage) / 100;


		for_each_online_cpu(cpu){
			work = &per_cpu(work_cpu_usage, cpu);
			workqueue = per_cpu(workqueue_cpu_usage, cpu);
			if (!work || !workqueue){
				PM_ERR("work or workqueue NULL\n");
				return n;
			}	
			queue_work_on(cpu, workqueue, work);
		}
#if 0
		del_timer(&arm_mode_timer);
		arm_mode_timer.expires	= jiffies + msecs_to_jiffies(ARM_MODE_TIMER_MSEC);
		add_timer(&arm_mode_timer);
#endif
	
	} else if (!strncmp(cmd, "stop", strlen("stop"))) {
开发者ID:netros,项目名称:rklinux4.4,代码行数:34,代码来源:cpu_usage.c

示例5: tfw_cache_req_process

void
tfw_cache_req_process(TfwHttpReq *req, tfw_http_req_cache_cb_t action,
		      void *data)
{
	int node;
	unsigned long key;

	if (!tfw_cfg.cache)
		return;

	key = tfw_cache_key_calc(req);

	node = tfw_cache_key_node(key);
	if (node != numa_node_id()) {
		/* Schedule the cache entry to the right node. */
		TfwCWork *cw = kmem_cache_alloc(c_cache, GFP_ATOMIC);
		if (!cw)
			goto process_locally;
		INIT_WORK(&cw->work, tfw_cache_req_process_node);
		cw->cw_req = req;
		cw->cw_act = action;
		cw->cw_data = data;
		cw->cw_key = key;
		queue_work_on(tfw_cache_sched_work_cpu(node), cache_wq,
			      (struct work_struct *)cw);
	}

process_locally:
	__cache_req_process_node(req, key, action, data);
}
开发者ID:pavel-odintsov,项目名称:tempesta,代码行数:30,代码来源:cache.c

示例6: lru_add_drain_all

void lru_add_drain_all(void)
{
	static DEFINE_MUTEX(lock);
	static struct cpumask has_work;
	int cpu;

	mutex_lock(&lock);
	get_online_cpus();
	cpumask_clear(&has_work);

	for_each_online_cpu(cpu) {
		struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);

		if (pagevec_count(&per_cpu(lru_add_pvec, cpu)) ||
		    pagevec_count(&per_cpu(lru_rotate_pvecs, cpu)) ||
		    pagevec_count(&per_cpu(lru_deactivate_file_pvecs, cpu)) ||
		    pagevec_count(&per_cpu(lru_deactivate_pvecs, cpu)) ||
		    need_activate_page_drain(cpu)) {
			INIT_WORK(work, lru_add_drain_per_cpu);
			queue_work_on(cpu, lru_add_drain_wq, work);
			cpumask_set_cpu(cpu, &has_work);
		}
	}

	for_each_cpu(cpu, &has_work)
		flush_work(&per_cpu(lru_add_drain_work, cpu));

	put_online_cpus();
	mutex_unlock(&lock);
}
开发者ID:forgivemyheart,项目名称:linux,代码行数:30,代码来源:swap.c

示例7: dt2w_input_event

static void dt2w_input_event(struct input_handle *handle, unsigned int type,
				unsigned int code, int value) {
#if DT2W_DEBUG
	pr_info("doubletap2wake: code: %s|%u, val: %i\n",
		((code==ABS_MT_POSITION_X) ? "X" :
		(code==ABS_MT_POSITION_Y) ? "Y" :
		(code==ABS_MT_TRACKING_ID) ? "ID" :
		"undef"), code, value);
#endif
	if (!scr_suspended)
		return;

	if (code == ABS_MT_SLOT) {
		doubletap2wake_reset();
		return;
	}

	if (code == ABS_MT_TRACKING_ID && value == -1) {
		touch_cnt = true;
		queue_work_on(0, dt2w_input_wq, &dt2w_input_work);
		return;
	}

	if (code == ABS_MT_POSITION_X) {
		touch_x = value;
		touch_x_called = true;
	}

	if (code == ABS_MT_POSITION_Y) {
		touch_y = value;
		touch_y_called = true;
	}
}
开发者ID:Soultwister,项目名称:ElementalX-N5,代码行数:33,代码来源:doubletap2wake.c

示例8: isert_cq_comp_handler

static void isert_cq_comp_handler(struct ib_cq *cq, void *context)
{
	struct isert_cq *cq_desc = context;

	queue_work_on(smp_processor_id(), cq_desc->cq_workqueue,
		      &cq_desc->cq_comp_work);
}
开发者ID:qtsky89,项目名称:scst,代码行数:7,代码来源:iser_rdma.c

示例9: s2s_input_event

static void s2s_input_event(struct input_handle *handle, unsigned int type,
				unsigned int code, int value) {

	if (code == ABS_MT_SLOT) {
		sweep2wake_reset();
		return;
	}

	if (code == ABS_MT_TRACKING_ID && value == -1) {
		sweep2wake_reset();
		return;
	}

	if (code == ABS_MT_POSITION_X) {
		touch_x = value;
		touch_x_called = true;
	}

	if (code == ABS_MT_POSITION_Y) {
		touch_y = value;
		touch_y_called = true;
	}

	if (touch_x_called && touch_y_called) {
		touch_x_called = false;
		touch_y_called = false;
		queue_work_on(0, s2s_input_wq, &s2s_input_work);
	}
}
开发者ID:davidmueller13,项目名称:m9-sweep2sleep,代码行数:29,代码来源:s2s_mod.c

示例10: lru_add_drain_all

/*
 * Doesn't need any cpu hotplug locking because we do rely on per-cpu
 * kworkers being shut down before our page_alloc_cpu_dead callback is
 * executed on the offlined cpu.
 * Calling this function with cpu hotplug locks held can actually lead
 * to obscure indirect dependencies via WQ context.
 */
void lru_add_drain_all(void)
{
	static DEFINE_MUTEX(lock);
	static struct cpumask has_work;
	int cpu;

	/*
	 * Make sure nobody triggers this path before mm_percpu_wq is fully
	 * initialized.
	 */
	if (WARN_ON(!mm_percpu_wq))
		return;

	mutex_lock(&lock);
	cpumask_clear(&has_work);

	for_each_online_cpu(cpu) {
		struct work_struct *work = &per_cpu(lru_add_drain_work, cpu);

		if (pagevec_count(&per_cpu(lru_add_pvec, cpu)) ||
		    pagevec_count(&per_cpu(lru_rotate_pvecs, cpu)) ||
		    pagevec_count(&per_cpu(lru_deactivate_file_pvecs, cpu)) ||
		    pagevec_count(&per_cpu(lru_lazyfree_pvecs, cpu)) ||
		    need_activate_page_drain(cpu)) {
			INIT_WORK(work, lru_add_drain_per_cpu);
			queue_work_on(cpu, mm_percpu_wq, work);
			cpumask_set_cpu(cpu, &has_work);
		}
	}

	for_each_cpu(cpu, &has_work)
		flush_work(&per_cpu(lru_add_drain_work, cpu));

	mutex_unlock(&lock);
}
开发者ID:Lyude,项目名称:linux,代码行数:42,代码来源:swap.c

示例11: __stop_machine

int __stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus)
{
	struct work_struct *sm_work;
	int i, ret;

	/* Set up initial state. */
	mutex_lock(&lock);
	num_threads = num_online_cpus();
	active_cpus = cpus;
	active.fn = fn;
	active.data = data;
	active.fnret = 0;
	idle.fn = chill;
	idle.data = NULL;

	set_state(STOPMACHINE_PREPARE);

	/* Schedule the stop_cpu work on all cpus: hold this CPU so one
	 * doesn't hit this CPU until we're ready. */
	get_cpu();
	for_each_online_cpu(i) {
		sm_work = percpu_ptr(stop_machine_work, i);
		INIT_WORK(sm_work, stop_cpu);
		queue_work_on(i, stop_machine_wq, sm_work);
	}
	/* This will release the thread on our CPU. */
	put_cpu();
	flush_workqueue(stop_machine_wq);
	ret = active.fnret;
	mutex_unlock(&lock);
	return ret;
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:32,代码来源:stop_machine.c

示例12: mali_dvfs_handler

void mali_dvfs_handler(u32 utilization)
{
    g_mali_dfs_var.dfs_Utilization = utilization;
    queue_work_on(0, mali_dvfs_wq,&mali_dvfs_work);
    g_mali_dfs_var.dfs_GpuUtilization = utilization;
    /*add error handle here*/
}
开发者ID:fly2436732935,项目名称:android_kernel_honor7_PLK-AL10_PLK-TL01H_PLK-UL00_PLK-CL00_PLK-TL00,代码行数:7,代码来源:mali_platform_dvfs.c

示例13: kbase_platform_dvfs_event

int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation)
{
	unsigned long flags;
	struct exynos_context *platform;

	KBASE_DEBUG_ASSERT(kbdev != NULL);
	platform = (struct exynos_context *) kbdev->platform_context;

	spin_lock_irqsave(&mali_dvfs_spinlock, flags);
	if (platform->time_tick < MALI_DVFS_TIME_INTERVAL) {
		platform->time_tick++;
		platform->time_busy += kbdev->pm.metrics.time_busy;
		platform->time_idle += kbdev->pm.metrics.time_idle;
	} else {
		platform->time_busy = kbdev->pm.metrics.time_busy;
		platform->time_idle = kbdev->pm.metrics.time_idle;
		platform->time_tick = 0;
	}

	if ((platform->time_tick == MALI_DVFS_TIME_INTERVAL) &&
		(platform->time_idle + platform->time_busy > 0))
			platform->utilisation = (100*platform->time_busy) / (platform->time_idle + platform->time_busy);

	mali_dvfs_status_current.utilisation = utilisation;

#ifdef MALI_DEBUG
	printk(KERN_INFO "\n[mali_devfreq]utilization: %d\n", utilisation);
#endif
	spin_unlock_irqrestore(&mali_dvfs_spinlock, flags);

	queue_work_on(0, mali_dvfs_wq, &mali_dvfs_work);
	/*add error handle here*/
	return MALI_TRUE;
}
开发者ID:saiyamd,项目名称:P900-kernel-source,代码行数:34,代码来源:mali_kbase_dvfs.c

示例14: kbase_platform_dvfs_event

int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation)
{
	unsigned long flags;
	struct rk_context *platform;

	BUG_ON(!kbdev);
	platform = (struct rk_context *)kbdev->platform_context;

	spin_lock_irqsave(&mali_dvfs_spinlock, flags);
	if (platform->time_tick < MALI_DVFS_TIME_INTERVAL) {
		platform->time_tick++;
		platform->time_busy += kbdev->pm.metrics.time_busy;
		platform->time_idle += kbdev->pm.metrics.time_idle;
	} else {
		platform->time_busy = kbdev->pm.metrics.time_busy;
		platform->time_idle = kbdev->pm.metrics.time_idle;
		platform->time_tick = 0;
	}

	if ((platform->time_tick == MALI_DVFS_TIME_INTERVAL) && (platform->time_idle + platform->time_busy > 0))
		platform->utilisation = (100 * platform->time_busy) / (platform->time_idle + platform->time_busy);

	mali_dvfs_status_current.utilisation = utilisation;
	spin_unlock_irqrestore(&mali_dvfs_spinlock, flags);

	queue_work_on(0, mali_dvfs_wq, &mali_dvfs_work);
	/*add error handle here */
	return MALI_TRUE;
}
开发者ID:Kasercorp,项目名称:kernel,代码行数:29,代码来源:mali_kbase_dvfs.c

示例15: schedule_link_to_demux

static inline void schedule_link_to_demux(struct mem_link_device *mld)
{
	struct link_device *ld = &mld->link_dev;
	struct delayed_work *dwork = &ld->rx_delayed_work;

	/*queue_delayed_work(ld->rx_wq, dwork, 0);*/
	queue_work_on(7, ld->rx_wq, &dwork->work);
}
开发者ID:ShedrockN4,项目名称:wiliteneo,代码行数:8,代码来源:link_device_memory_main.c


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