text
stringlengths 0
14.1k
|
---|
break;
|
case CPUFREQ_GOV_LIMITS:
|
mutex_lock(&this_darkness_cpuinfo->timer_mutex);
|
if (!this_darkness_cpuinfo->cur_policy->cur
|
|| !policy->cur) {
|
pr_debug(""Unable to limit cpu freq due to cur_policy == NULL\n"");
|
mutex_unlock(&this_darkness_cpuinfo->timer_mutex);
|
return -EPERM;
|
}
|
__cpufreq_driver_target(this_darkness_cpuinfo->cur_policy,
|
policy->cur, CPUFREQ_RELATION_L);
|
mutex_unlock(&this_darkness_cpuinfo->timer_mutex);
|
break;
|
}
|
return 0;
|
}
|
#ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_DARKNESS
|
static
|
#endif
|
struct cpufreq_governor cpufreq_gov_darkness = {
|
.name = ""darkness"",
|
.governor = cpufreq_governor_darkness,
|
.owner = THIS_MODULE,
|
};
|
static int __init cpufreq_gov_darkness_init(void)
|
{
|
return cpufreq_register_governor(&cpufreq_gov_darkness);
|
}
|
static void __exit cpufreq_gov_darkness_exit(void)
|
{
|
cpufreq_unregister_governor(&cpufreq_gov_darkness);
|
}
|
MODULE_AUTHOR(""Alucard24@XDA"");
|
MODULE_DESCRIPTION(""'cpufreq_darkness' - A dynamic cpufreq/cpuhotplug governor v4.5 (SnapDragon)"");
|
MODULE_LICENSE(""GPL"");
|
#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_DARKNESS
|
fs_initcall(cpufreq_gov_darkness_init);
|
#else
|
module_init(cpufreq_gov_darkness_init);
|
#endif
|
module_exit(cpufreq_gov_darkness_exit);
|
" gpl-2.0
|
mrunix/streambase external/tb-common-utils/tbsys/src/filequeuethread.cc 2126 "/*
|
* (C) 2007-2010 Taobao Inc.
|
*
|
* This program is free software; you can redistribute it and/or modify
|
* it under the terms of the GNU General Public License version 2 as
|
* published by the Free Software Foundation.
|
*
|
*
|
* Version: $Id$
|
*
|
* Authors:
|
* duolong <[email protected]>
|
*
|
*/
|
#include ""tbsys.h""
|
namespace tbsys {
|
/* ¹¹Ô캯Êý */
|
CFileQueueThread::CFileQueueThread(CFileQueue* queue, int threadCount, IQueueHandler* handler, void* args) :
|
CDefaultRunnable(threadCount) {
|
assert(queue != NULL);
|
_queue = queue;
|
_handler = handler;
|
_args = args;
|
}
|
/* Îö¹¹º¯Êý */
|
CFileQueueThread::~CFileQueueThread(void) {
|
stop();
|
}
|
/* дÈëÊý¾Ý */
|
int CFileQueueThread::writeData(void* data, int len) {
|
if (data == NULL || len <= 0) {
|
return EXIT_FAILURE;
|
}
|
_mutex.lock();
|
_queue->push(data, len);
|
_mutex.signal();
|
_mutex.unlock();
|
return EXIT_SUCCESS;
|
}
|
/* ֹͣ */
|
void CFileQueueThread::stop() {
|
_mutex.lock();
|
_stop = true;
|
_mutex.broadcast();
|
_mutex.unlock();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.