这篇教程C++ task_exit函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中task_exit函数的典型用法代码示例。如果您正苦于以下问题:C++ task_exit函数的具体用法?C++ task_exit怎么用?C++ task_exit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了task_exit函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: rudy_eye_updatevoid rudy_eye_update (void){ switch (EYE_DIRECTION (rudy_eyes)) { case EYES_STRAIGHT: eye_direction_stop (); break; case EYES_LEFT: eye_direction_start_reverse (); task_recreate_gid_while (GID_RUDY_EYE_TIMEOUT, rudy_eyedir_timeout, TASK_DURATION_INF); break; case EYES_RIGHT: eye_direction_start_forward (); task_recreate_gid_while (GID_RUDY_EYE_TIMEOUT, rudy_eyedir_timeout, TASK_DURATION_INF); break; } switch (EYE_LID(rudy_eyes)) { case EYELID_NORMAL: case EYELID_OPEN: sol_request (SOL_EYELIDS_OPEN); break; case EYELID_CLOSED: sol_request (SOL_EYELIDS_CLOSED); break; } task_sleep_sec (2); task_exit ();}
开发者ID:CardonaPinball,项目名称:freewpc,代码行数:33,
示例2: rudy_blink_taskstatic void rudy_blink_task (void){ rudy_eye_change (EYELID_CLOSED); task_sleep_sec (1); rudy_eye_change (EYELID_OPEN); task_exit ();}
开发者ID:CardonaPinball,项目名称:freewpc,代码行数:7,
示例3: rudy_eyedir_timeoutstatic void rudy_eyedir_timeout (void){ task_sleep_sec (4); eye_direction_stop (); rudy_eyes &= (EYES_LEFT | EYES_RIGHT); task_exit ();}
开发者ID:CardonaPinball,项目名称:freewpc,代码行数:7,
示例4: 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,
示例5: gumball_divertor_open_taskstatic void gumball_divertor_open_task (void){ gumball_div_start (); task_sleep_sec (2); gumball_div_stop (); task_exit ();}
开发者ID:SonnyJim,项目名称:freewpc,代码行数:7,
示例6: _exitvoid _exit(int status){ struct tcb_s* tcb; /* Disable interrupts. They will be restored when the next * task is started. */ (void)irqsave(); slldbg("TCB=%p exiting/n", g_readytorun.head);#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG) slldbg("Other tasks:/n"); sched_foreach(_up_dumponexit, NULL);#endif /* Destroy the task at the head of the ready to run list. */ (void)task_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. */ tcb = (struct tcb_s*)g_readytorun.head; /* Then switch contexts */ up_fullcontextrestore(tcb->xcp.regs);}
开发者ID:centurysys,项目名称:NuttX-SA1xx,代码行数:31,
示例7: abort_monitor_taskvoid abort_monitor_task (void){ U8 count = 3; while (count > 0) { task_sleep (TIME_66MS); if (!switch_poll_logical (SW_LEFT_BUTTON) || !switch_poll_logical (SW_RIGHT_BUTTON)) { task_exit (); } count--; } callset_invoke (flipper_abort); task_exit ();}
开发者ID:Curbfeeler,项目名称:freewpc,代码行数:16,
示例8: amode_leff/**************************************************************************** * * attract mode lighting effects * ***************************************************************************/void amode_leff (void) { U8 i; gi_leff_enable (PINIO_GI_STRINGS); lamplist_set_apply_delay (TIME_16MS); for (;;) { lamplist_apply (LAMPLIST_BOTTOM_TOP, leff_toggle); //toggle task_sleep (TIME_100MS); lamplist_apply (LAMPLIST_TOP_BOTTOM, leff_toggle); //toggle task_sleep (TIME_100MS); for (i=0; i < 10; i++) { lamplist_apply (LAMPLIST_AMODE_ALL, leff_toggle); //toggle task_sleep (TIME_100MS); }//end of loop lamplist_apply (LAMPLIST_LEFT_RIGHT, leff_toggle); //toggle task_sleep (TIME_100MS); lamplist_apply (LAMPLIST_RIGHT_LEFT, leff_toggle); //toggle task_sleep (TIME_100MS); for (i=0; i < 10; i++) { lamplist_apply (LAMPLIST_AMODE_ALL, leff_toggle); //toggle task_sleep (TIME_100MS); }//end of loop}//end of endless loop task_exit ();}//end of function
开发者ID:CardonaPinball,项目名称:freewpc_DM,代码行数:32,
示例9: _exitvoid _exit(int status){ FAR struct tcb_s* tcb; /* Disable interrupts. Interrupts will remain disabled until * the new task is resumed below. */ (void)irqsave(); slldbg("TCB=%p exiting/n", tcb);#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG) lldbg("Other tasks:/n"); sched_foreach(_up_dumponexit, NULL);#endif /* Destroy the task at the head of the ready to run list. */ (void)task_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. */ tcb = (FAR struct tcb_s*)g_readytorun.head; slldbg("New Active Task TCB=%p/n", tcb); /* Then switch contexts */ RESTORE_USERCONTEXT(tcb);}
开发者ID:centurysys,项目名称:NuttX-SA1xx,代码行数:32,
示例10: lock_and_outhole_monitorstatic void lock_and_outhole_monitor (void){ /* Wait for balls to settle/amode to start before emptying * locks/outhole */ task_sleep_sec (3); while (!in_live_game) { if (switch_poll (SW_LOCK_LOWER)) { device_request_kick (device_entry (DEVNO_LOCK)); } if (switch_poll (SW_OUTHOLE)) { sol_request (SOL_OUTHOLE); } if (!switch_poll (SW_AUTOFIRE2)) { callset_invoke (clear_autofire); } /* Wait for the balls to be cleared before starting again */ task_sleep_sec (3); } task_exit ();}
开发者ID:SonnyJim,项目名称:freewpc,代码行数:25,
示例11: amode_talking_taskstatic void amode_talking_task (void){ sound_send (SND_NOT_AN_ORDINARY_DAY); task_sleep_sec (2); sound_send (SND_OR_AN_ORDINARY_PLAYER); task_exit ();}
开发者ID:SonnyJim,项目名称:freewpc,代码行数:7,
示例12: loop_level_timer_task/* TODO This needs to be changed so it'll handle system wide * pausing properly */static void loop_level_timer_task (void){ while (in_live_game) { if (left_loop_timer == 0 && left_loop_level != 0) { bounded_decrement (left_loop_level, 0); left_loop_timer = LOOP_LEVEL_DELAY; } else { bounded_decrement (left_loop_timer, 0); } if (right_loop_timer == 0 && right_loop_level != 0) { bounded_decrement (right_loop_level, 0); right_loop_timer = LOOP_LEVEL_DELAY; } else { bounded_decrement (right_loop_timer, 0); } task_sleep_sec (1); } task_exit ();}
开发者ID:hydra,项目名称:freewpc,代码行数:29,
示例13: dispatcher_bodyvoid dispatcher_body(){ int err, t0, t1; task_t* next; // Tarefa que ocupara o processador. enable_preemption(0); // Caso haver alguma tarefa na lista de prontas // o while eh executado. while (list_size(ready_list) > 0) { t0 = systime(); next = scheduler(); if (next) { ticks = 20; enable_preemption(1); t1 = systime(); curr_task->proc_time += t0 - t1; t0 = systime(); err = task_switch(next); t1 = systime(); next->proc_time += t1 - t0; if (err == -1) { perror("dispatcher_body: task_switch failed./n"); return; } } } // Finaliza o dispatcher, voltando para o main. task_exit(0);}
开发者ID:bmeneguele,项目名称:sist-op,代码行数:35,
示例14: huxley_reminder_task/**************************************************************************** * reminder when mode enabled but not started yet ***************************************************************************/void huxley_reminder_task (void) { for (;;) { task_sleep_sec(67); deff_start (DEFF_HUXLEY_INFO_EFFECT); }//end of loop task_exit();}//end of function
开发者ID:CardonaPinball,项目名称:freewpc,代码行数:10,
示例15: shooter_clear_monitorvoid shooter_clear_monitor (void){ task_add_duration (TASK_DURATION_INF); task_sleep_sec (4); /* this could be machine-specific */ global_flag_off (GLOBAL_FLAG_BALL_AT_PLUNGER); task_exit ();}
开发者ID:SonnyJim,项目名称:freewpc,代码行数:7,
示例16: _exitvoid _exit(int status){ struct tcb_s* tcb; /* Destroy the task at the head of the ready to run list. */ (void)task_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. */ tcb = this_task();#ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously running * task is closed down gracefully (data caches dump, MMU flushed) and * set up the address environment for the new thread at the head of * the ready-to-run list. */ (void)group_addrenv(tcb);#endif /* Then switch contexts */ up_switchcontext(NULL, tcb);}
开发者ID:acassis,项目名称:ros2_nuttx,代码行数:28,
示例17: _exitvoid _exit(int status){ FAR struct tcb_s *tcb; sinfo("TCB=%p exiting/n", tcb); /* Destroy the task at the head of the ready to run list. */ (void)task_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. */ tcb = this_task(); sinfo("New Active Task TCB=%p/n", tcb); /* The way that we handle signals in the simulation is kind of * a kludge. This would be unsafe in a truly multi-threaded, interrupt * driven environment. */ if (tcb->xcp.sigdeliver) { sinfo("Delivering signals TCB=%p/n", tcb); ((sig_deliver_t)tcb->xcp.sigdeliver)(tcb); tcb->xcp.sigdeliver = NULL; } /* Then switch contexts */ up_longjmp(tcb->xcp.regs, 1);}
开发者ID:AlexShiLucky,项目名称:NuttX,代码行数:33,
示例18: _exitvoid _exit(int status){ struct tcb_s *tcb; /* Disable interrupts. They will be restored when the next task is * started. */ (void)up_irq_save(); sinfo("TCB=%p exiting/n", this_task());#ifdef CONFIG_DUMP_ON_EXIT sinfo("Other tasks:/n"); sched_foreach(_xtensa_dumponexit, NULL);#endif#if XCHAL_CP_NUM > 0 /* Disable co-processor support for the task that is exit-ing. */ tcb = this_task(); xtensa_coproc_disable(&tcb->xcp.cpstate, XTENSA_CP_ALLSET);#endif /* Destroy the task at the head of the ready to run list. */ (void)task_exit(); /* Now, perform the context switch to the new ready-to-run task at the * head of the list. */ tcb = this_task();#if XCHAL_CP_NUM > 0 /* Set up the co-processor state for the newly started thread. */ xtensa_coproc_restorestate(&tcb->xcp.cpstate);#endif#ifdef CONFIG_ARCH_ADDRENV /* Make sure that the address environment for the previously running * task is closed down gracefully (data caches dump, MMU flushed) and * set up the address environment for the new thread at the head of * the ready-to-run list. */ (void)group_addrenv(tcb);#endif /* Then switch contexts */ xtensa_context_restore(tcb->xcp.regs); /* xtensa_full_context_restore() should not return but could if the software * interrupts are disabled. */ PANIC();}
开发者ID:a1ien,项目名称:nuttx,代码行数:60,
示例19: switch_lamp_pulse/** Task that performs a switch lamp pulse. * Some switches are inherently tied to a lamp. When the switch * triggers, the lamp can be automatically flickered. This is * implemented as a pseudo-lamp effect, so the true state of the * lamp is not disturbed. */void switch_lamp_pulse (void){ lamp_pulse_data_t * const cdata = task_current_class_data (lamp_pulse_data_t); /* Although not a true leff, this fools the lamp draw to doing * the right thing. */ cdata->leffdata.flags = L_SHARED; /* If the lamp is already allocated by another lamp effect, then don't bother trying to do the pulse. */ if (lamp_leff2_test_and_allocate (cdata->swinfo->lamp)) { /* Change the state of the lamp */ if (lamp_test (cdata->swinfo->lamp)) leff_off (cdata->swinfo->lamp); else leff_on (cdata->swinfo->lamp); task_sleep (TIME_200MS); /* Change it back */ leff_toggle (cdata->swinfo->lamp); task_sleep (TIME_200MS); /* Free the lamp */ lamp_leff2_free (cdata->swinfo->lamp); } task_exit ();}
开发者ID:Curbfeeler,项目名称:freewpc,代码行数:32,
示例20: pitstop_award_taskvoid pitstop_award_task(void) { deff_start_sync(DEFF_PITSTOP_AWARD); switch (pitstop_award) { case AWARD_SCORE_50M: score(SC_50M); break; case AWARD_SCORE_5M: score(SC_5M); break; case AWARD_CAR: award_car(); break; case AWARD_EXTRA_BALL: increment_extra_balls(); break; case AWARD_LITE_LOCK: zr1_mb_award_lite_lock(); break; case AWARD_LITE_DRAGRACE: award_lite_dragrace(); break; case AWARD_LITE_KICKBACK: award_kickback (); break; default: // TODO handle remaining awards break; } task_exit();}
开发者ID:hydra,项目名称:freewpc,代码行数:32,
示例21: cryoprison_jackpot_sounds_taskvoid cryoprison_jackpot_sounds_task(void) { U8 cryoprison_MessageCounter; cryoprison_MessageCounter = random_scaled(3); if (++cryoprison_jackpot_shots_made % 2 == 0) { switch (cryoprison_MessageCounter) { case 0: sound_start (ST_SPEECH, SPCH_DOUBLE_JACKPOT_WES, SL_2S, PRI_GAME_QUICK5); break; case 1: sound_start (ST_SPEECH, SPCH_DOUBLE_JACKPOT_SLY, SL_2S, PRI_GAME_QUICK5); break; case 2: sound_start (ST_SPEECH, SPCH_DOUBLE, SL_2S, PRI_GAME_QUICK5); break; }//end of switch }//end of if else { switch (cryoprison_MessageCounter) { case 0: sound_start (ST_SPEECH, SPCH_AHHHGGG, SL_2S, PRI_GAME_QUICK5); break; case 1: sound_start (ST_SPEECH, SPCH_JOHN_SCREAM, SL_2S, PRI_GAME_QUICK5); break; case 2: sound_start (ST_SPEECH, SPCH_UHHN, SL_2S, PRI_GAME_QUICK5); break; }//end of switch }//end of else task_sleep (TIME_500MS); sound_start (ST_EFFECT, FREEZE5, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, FREEZE5, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, FREEZE5, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, FREEZE5, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, EJECT, SL_2S, PRI_GAME_QUICK5); task_sleep (TIME_500MS); task_exit();}//end of mode_effect_deff
开发者ID:CardonaPinball,项目名称:freewpc,代码行数:30,
示例22: autofire_monitor/** A task that manages the autolaunching of balls.Upon entry, the autofire divertor solenoid is already pulsingand a ball is being kicked from the trough. */void autofire_monitor (void){ /* Open the divertor to catch the ball. Because it may be coming from either the trough or a ramp divert, the timings are variable. */ if (shooter_div_delay_time) task_sleep_sec (shooter_div_delay_time); autofire_busy = TRUE; //if (autofire_full () // don't open to catch shooter_div_start (); /* TODO - If the autofire switch trips during the 'open time', we can abort this delay early and go ahead and close the divertor. This is safe because only one ball can appear here at a time. */ //task_sleep_sec (shooter_div_open_time); autofire_ball_catch_wait (); shooter_div_stop (); /* Wait a little longer for the ball to settle */ task_sleep (TIME_200MS); /* If Right inlane -> Left ramp combo, start tnf mode */ if (event_did_follow (left_ramp_exit, tnf) && single_ball_play ()) { callset_invoke (tnf_start); } /* Wait until allowed to kickout */ while (kickout_locks > 0) task_sleep (TIME_100MS); /* Open diverter again */ shooter_div_start (); /* Wait for the diverter to fully open before firing */ U8 timeout = 20; while (--timeout != 0) task_sleep (TIME_100MS); if (in_live_game && single_ball_play ()) { sound_send (SND_EXPLOSION_1); leff_start (LEFF_STROBE_UP); } /* Say that the ball is heading into the right loop */ timer_restart_free (GID_BALL_LAUNCH, TIME_3S); event_can_follow (autolaunch, right_loop, TIME_4S); /* Clear the magnet so we can fire a ball */ magnet_disable_catch (MAG_RIGHT); /* Launch the ball */ sol_request (SOL_AUTOFIRE); /* Wait for the ball to clear the divertor * before closing*/ task_sleep (TIME_700MS); shooter_div_stop (); autofire_busy = FALSE; task_exit ();}
开发者ID:SonnyJim,项目名称:freewpc,代码行数:62,
示例23: kill_taskint kill_task (int tid) { struct tsk * p = (struct tsk *) find_task (tid); if (!p) return -1; task_exit (p); return 0;}
开发者ID:chandru1985,项目名称:TmULThreads,代码行数:8,
示例24: fortress_start_soundsvoid fortress_start_sounds (void) { U8 i; for(i = 0; i < 8; i++) { sound_start (ST_EFFECT, HELICOPTER, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_500MS); } task_exit();}//end of function
开发者ID:CardonaPinball,项目名称:freewpc_DM,代码行数:8,
示例25: cryoprison_start_soundsvoid cryoprison_start_sounds (void) { U8 i; for(i = 0; i < 6; i++) { sound_start (ST_ANY, SIREN, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_500MS); } task_exit();}//end of function
开发者ID:CardonaPinball,项目名称:freewpc,代码行数:8,
示例26: tnf_sound_taskstatic void tnf_sound_task (void){ if (tnf_buttons_pressed < tnf_target - 10) sound_send (SND_BUYIN_CANCELLED); else sound_send (SND_CLOCK_CHAOS_END_BOOM); task_exit ();}
开发者ID:SonnyJim,项目名称:freewpc,代码行数:8,
示例27: extraball_reminder_taskvoid extraball_reminder_task (void) { for (;;) { if ( (extraball_SoundCounter++ % 2) == 0 ) sound_start (ST_SPEECH, SPCH_GET_THE_EXTRABALL, SL_4S, PRI_GAME_QUICK5); else sound_start (ST_SPEECH, SPCH_NEED_EXTRABALL, SL_4S, PRI_GAME_QUICK5); task_sleep_sec(14); }//end of loop task_exit();}//end of function
开发者ID:CardonaPinball,项目名称:freewpc_DM,代码行数:8,
示例28: initial_task_funcvoid initial_task_func(void){ int ret; exit_critical_section(); ret = current_task->entry(current_task->args); task_exit(ret);}
开发者ID:yannik520,项目名称:YakOS,代码行数:8,
示例29: flipcode_active_taskstatic void flipcode_active_task (void){ /* Anytime either flipper is pressed, this task is restarted. After so many seconds of inactivity, the flipper code will reset to zero. */ task_sleep_sec (5); flipcode_reset (); task_exit ();}
开发者ID:lolzmania,项目名称:freewpc,代码行数:9,
示例30: fortress_ballsave_taskvoid fortress_ballsave_task (void) {#ifdef CONFIG_DIFFICULTY_LEVEL task_sleep_sec(system_config.mb_ballsave);#elif task_sleep_sec(5);#endif fortress_ballsave = FALSE; task_exit();}//end of function
开发者ID:CardonaPinball,项目名称:freewpc_DM,代码行数:9,
注:本文中的task_exit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ task_for_pid函数代码示例 C++ task_create函数代码示例 |