这篇教程C++ task_create函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中task_create函数的典型用法代码示例。如果您正苦于以下问题:C++ task_create函数的具体用法?C++ task_create怎么用?C++ task_create使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了task_create函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: app_mainvoid app_main(){#if sem_test sem_init(&sem, (U8 *)"sem1", 1);#endif#if mutex_test mutex_init(&mutex, (U8 *)"mutex1");#endif#if msg_queue_test msg_queue_create(&my_queue, 100, (U8 *)"my_queue"); msg_queue_create(&my_queue1, 100, (U8 *)"my_queue1"); msg_queue_create(&my_queue2, 100, (U8 *)"my_queue2"); msg1.buff = (U8 *)"1aaa"; msg2.buff = (U8 *)"2bbb"; msg3.buff = (U8 *)"3ccc"; msg4.buff = (U8 *)"4aaa"; msg5.buff = (U8 *)"5bbb"; msg6.buff = (U8 *)"6ccc"; msg7.buff = (U8 *)"7aaa"; msg8.buff = (U8 *)"8bbb"; msg9.buff = (U8 *)"9ccc";#endif task_create(&tcb1, (U8 *)"task1", task1, NULL, stack1, STACK_SIZE, 3, 1); task_create(&tcb2, (U8 *)"task2", task2, NULL, stack2, STACK_SIZE, 4, 1); //task_create(&tcb3, (U8 *)"task3", task3, NULL, stack3, STACK_SIZE, 3, 1); //task_create(&tcb4, (U8 *)"task4", task4, NULL, stack4, STACK_SIZE, 1, 1);}
开发者ID:LastRitter,项目名称:fos,代码行数:29,
示例2: init_timer_mgrint init_timer_mgr (void){ int i = TIMER_WHEEL; tmtaskid_t btmhlftask_id = 0; tmtaskid_t task_id = 0; timer_rq_init (); EventInit (&timer_event);#ifdef TIMER_BTM_HALF if (task_create ("TMRBHF", 99, TSK_SCHED_RR, 32000, tick_service, NULL, NULL, &btmhlftask_id) == TSK_FAILURE) { return FAILURE; }#endif if (task_create ("TMRTHF", 99, TSK_SCHED_RR, 32000, tick_clock, NULL, NULL, &task_id) == TSK_FAILURE) { return FAILURE; } while (--i >= 0) { create_sync_lock (&tmrrq.root[i].lock); sync_unlock (&tmrrq.root[i].lock); } timer_lock_create ();#ifdef TIMER_BTM_HALF bh_timer_lock_create ();#endif return SUCCESS;}
开发者ID:williamtoyang,项目名称:LinuxRouter,代码行数:35,
示例3: mainint main (int argc, char *argv[]){ printf ("Main INICIO/n") ; task_init () ; sem_create (&s1, 1) ; sem_create (&s2, 0) ; task_create (&a1, TaskA, "A1") ; task_create (&a2, TaskA, " A2") ; task_create (&b1, TaskB, " B1") ; task_create (&b2, TaskB, " B2") ; task_join (&a1) ; sem_destroy (&s1) ; sem_destroy (&s2) ; task_join (&a2) ; task_join (&b1) ; task_join (&b2) ; printf ("Main FIM/n") ; task_exit (0) ; exit (0) ;}
开发者ID:bmeneguele,项目名称:sist-op,代码行数:28,
示例4: test_readwrite_startstatic void test_readwrite_start(int n){ rw_task_finished = 0; sem_initialize(&sem_rw, 1); mtx_initialize(&mtx_rw); taskrw[0] = task_create("tRA", task_reader, &n, NULL, 0x1000, 220, 10, 0); task_resume_noschedule(taskrw[0]); taskrw[1] = task_create("tRB", task_reader, &n, NULL, 0x1000, 220, 10, 0); task_resume_noschedule(taskrw[1]); taskrw[2] = task_create("tRC", task_reader, &n, NULL, 0x1000, 220, 10, 0); task_resume_noschedule(taskrw[2]); taskrw[3] = task_create("tWA", task_writer, &n, NULL, 0x1000, 220, 10, 0); task_resume_noschedule(taskrw[3]); /* wait test task to exit */ printf("Reader/Writer started/n"); while(rw_task_finished < 4) task_delay(50); printf("Reader/Writer finished/n");}
开发者ID:phuuix,项目名称:probability,代码行数:25,
|