Пример #1
0
void TaskQueue::AppendFunction(const boost::function1<void, TaskQueue&>& fn)
{
	boost::recursive_mutex::scoped_lock lock(queueMutex);

	queuedTasks.push(TaskEntry(fn));

	Notify();
}
Пример #2
0
void TaskQueue::AppendMessage(POVMS_Message& msg)
{
	boost::recursive_mutex::scoped_lock lock(queueMutex);

	queuedTasks.push(TaskEntry(msg));

	Notify();
}
 void AsioServerTransport::onServiceAdded(RcfServer &server)
 {
     setServer(server);
     WriteLock writeLock( getTaskEntriesMutex() );
     getTaskEntries().clear();
     getTaskEntries().push_back(
         TaskEntry(
         boost::bind(&AsioServerTransport::cycle, this, _1, _2, _3),
         boost::bind(&AsioServerTransport::stop, this),
         "RCF Asio server"));
 }
Пример #4
0
Task::TaskData *TaskQueue::AppendTask(Task *task)
{
	boost::recursive_mutex::scoped_lock lock(queueMutex);

	failed = false;

	queuedTasks.push(TaskEntry(shared_ptr<Task>(task)));

	Notify();

	return task->GetDataPtr();
}
Пример #5
0
/**
 * 主核初始化
 */
asmlinkage void __init start_master(void)
{
	debug_printstr_mmu("xby_debug, start cpu 0\n");

	local_irq_disable();

	//tick_init();
	
	/* 为当前CPU设置其活动掩码 */
	boot_cpu_init();
	/* 体系结构特定的初始化过程 */
	start_arch();

	//初始化boot内存分配器
	InitBootMemory(0xc0000000 + 8 * 1024 * 1024, 0xc0000000 + 24 * 1024 * 1024);
	
	init_IRQ();
	//体系结构和驱动的一些初始化过程
	//run_initcall();

	//为VFS分配一些大的内存块,用于哈希表。此过程必须在boot阶段分配。
	//vfs_caches_init_early();

#ifdef FS
	blk_dev_init();
	inode_init();
	file_table_init();
	name_cache_init();
	buffer_init_early();
#endif
	memory_init();
#ifdef FS
	buffer_init_tail();
	tty_init();
#endif
	sched_init();
	time_init();
	setup_timer();
	serial_init();
	//mmc_init();
	//omap_gpio_init();
	//初始化文件系统
	//vfs_caches_init(num_physpages);
	local_irq_enable();

	//创建系统任务,以及用户任务入口
	TaskEntry();
	cpu_idle();

	//不可能运行到这里来
	BUG();
}
    void ObjectFactoryService::onServiceAdded(RcfServer &server)
    {
        server.bind<I_ObjectFactory>(*this);

        mTaskEntries.clear();

        mTaskEntries.push_back(
            TaskEntry(
            boost::bind(&ObjectFactoryService::cycleCleanup, this, _1),
            boost::bind(&ObjectFactoryService::stopCleanup, this),
            "RCF Ofs cleanup",
            false));
    }
    void PingBackService::onServiceAdded(RcfServer &server)
    {
        RCF_UNUSED_VARIABLE(server);

        mStopFlag = false;

        WriteLock writeLock(getTaskEntriesMutex());
        getTaskEntries().clear();
        getTaskEntries().push_back( TaskEntry(
            boost::bind(&PingBackService::cycle, this, _1, _2),
            boost::bind(&PingBackService::stop, this),
            "RCF Pingback"));
    }
Пример #8
0
    void SessionTimeoutService::onServiceAdded(RcfServer &server)
    {
        mpRcfServer = & server;

        mStopFlag = false;

        mTaskEntries.clear();

        mTaskEntries.push_back( TaskEntry(
            boost::bind(&SessionTimeoutService::cycle, this, _1, _2),
            boost::bind(&SessionTimeoutService::stop, this),
            "RCF Session Timeout"));
    }
    void UdpServerTransport::onServiceAdded(RcfServer &server)
    {
        setSessionManager(server);

        mTaskEntries.clear();

        mTaskEntries.push_back(
            TaskEntry(
                boost::bind(
                    &UdpServerTransport::cycleTransportAndServer,
                    this,
                    _1),
                StopFunctor(),
                "RCF UDP server"));
    }
Пример #10
0
    void ObjectFactoryService::onServiceAdded(RcfServer &server)
    {
        server.bind((I_ObjectFactory *) NULL, *this);

        onServiceAddedProto(*this, server);

        mTaskEntries.clear();

        mTaskEntries.push_back(
            TaskEntry(
            boost::bind(&ObjectFactoryService::cycleCleanup, this, _1, _2),
            boost::bind(&ObjectFactoryService::stopCleanup, this),
            "RCF Ofs cleanup"));

        mStopFlag = false;
    }
    void UdpServerTransport::onServiceAdded(RcfServer &server)
    {
        setSessionManager(server);
        WriteLock writeLock( getTaskEntriesMutex() );
        getTaskEntries().clear();

        getTaskEntries().push_back(
            TaskEntry(
                boost::bind(
                    &UdpServerTransport::cycleTransportAndServer,
                    this,
                    boost::ref(server),
                    _1,
                    _2),
                StopFunctor(),
                "RCF Udp server"));

        mStopFlag = false;
    }
Пример #12
0
	STD_TRUE,		/* vTask3 */
};
#endif

#if (cfgOS_CONFORMANCE_CLASS == ECC2 || cfgOS_CONFORMANCE_CLASS == ECC1)
const uint8_t OSTskClsTypeTable[cfgOS_TASK_NUM] =
{
	BASIC_TASK, 		/* vTask1 */
	EXTEND_TASK, 		/* vTask2 */
	EXTEND_TASK, 		/* vTask3 */
};
#endif

const TaskEntryType OSTaskEntryTable[cfgOS_TASK_NUM]=
{
	TaskEntry(vTask1),
	TaskEntry(vTask2),
	TaskEntry(vTask3),
};

uint32_t g_TestResult = 0;
#define TEST_TOTAL 5
void StartupHook(void)
{
    TestHead("Task",TEST_TOTAL);
}
void ShutdownHook ( StatusType xError)
{
    TestEnd(g_TestResult,TEST_TOTAL);
}
static uint8_t g_tp00 = 0xFF;
Пример #13
0
	STD_TRUE,		/* vTask1 */
	STD_TRUE,		/* vTask2 */
};
#endif

#if (cfgOS_CONFORMANCE_CLASS == ECC2 || cfgOS_CONFORMANCE_CLASS == ECC1)
const uint8_t OSTskClsTypeTable[cfgOS_TASK_NUM] =
{
	BASIC_TASK, 		/* vTask1 */
	BASIC_TASK, 		/* vTask2 */
};
#endif

const TaskEntryType OSTaskEntryTable[cfgOS_TASK_NUM]=
{
	&TaskEntry(vTask1),
	&TaskEntry(vTask2),
};

uint8_t g_tp06 = 0xff;
uint8_t g_tp10 = 0xff;

uint32_t g_TestResult = 0;
#define TEST_TOTAL 10
void StartupHook(void)
{
    TestHead("Task",TEST_TOTAL);
}
void ShutdownHook ( StatusType xError)
{
    TestEnd(g_TestResult,TEST_TOTAL);
void AsioServerTransport::onServiceAdded(RcfServer &server)
{
    setServer(server);
    mTaskEntries.clear();
    mTaskEntries.push_back(TaskEntry(Mt_Asio));
}
Пример #15
0
const uint8_t OSTskClsTypeTable[cfgOS_TASK_NUM] =
{
	BASIC_TASK, 		/* vTask1 */
	BASIC_TASK, 		/* vTask2 */
	BASIC_TASK, 		/* vTask3 */
	BASIC_TASK, 		/* vTask4 */
	BASIC_TASK, 		/* vTask5 */
	BASIC_TASK, 		/* vTask6 */
	BASIC_TASK, 		/* vTask7 */
	BASIC_TASK, 		/* vTask8 */
};
#endif

const TaskEntryType OSTaskEntryTable[cfgOS_TASK_NUM]=
{
	TaskEntry(vTask1),
	TaskEntry(vTask2),
	TaskEntry(vTask3),
	TaskEntry(vTask4),
	TaskEntry(vTask5),
	TaskEntry(vTask6),
	TaskEntry(vTask7),
	TaskEntry(vTask8),
};
uint32_t g_TestResult = 0;
#define TEST_TOTAL 1
void StartupHook(void)
{
    TestHead("Task",TEST_TOTAL);
}
void ShutdownHook ( StatusType xError)