Esempio n. 1
0
/*                 *****  do_shutdown  *****

   This is the main system shutdown function, and the ONLY function
   that should EVER be called to shut the system down. It calls one
   or more of the above static helper functions as needed.
*/
void do_shutdown()
{
TID tid;
    if(is_wait_sigq_pending())
        cancel_wait_sigq();
    else
        if(can_signal_quiesce() && !signal_quiesce(0,0))
            create_thread(&tid, DETACHED, do_shutdown_wait,
                          NULL, "do_shutdown_wait");
        else
            do_shutdown_now();
}
Esempio n. 2
0
static void wait_sigq_resp()
{
int pending, i;
    /* Wait for all CPU's to stop */
    do
    {
        OBTAIN_INTLOCK(NULL);
        wait_sigq_pending = 0;
        for (i = 0; i < MAX_CPU_ENGINES; i++)
        if (IS_CPU_ONLINE(i)
          && sysblk.regs[i]->cpustate != CPUSTATE_STOPPED)
            wait_sigq_pending = 1;
        pending = wait_sigq_pending;
        RELEASE_INTLOCK(NULL);

        if(pending)
            SLEEP(1);
    }
    while(is_wait_sigq_pending());
}
Esempio n. 3
0
/*                 *****  do_shutdown  *****

   This is the main system shutdown function, and the ONLY function
   that should EVER be called to shut the system down. It calls one
   or more of the above static helper functions as needed.
*/
void do_shutdown()
{
TID tid;
#if defined(_MSVC_)
    if ( sysblk.shutimmed )
        do_shutdown_now();
    else
    {
#endif // defined(_MSVC_)
        if(is_wait_sigq_pending())
            cancel_wait_sigq();
        else
            if(can_signal_quiesce() && !signal_quiesce(0,0))
                create_thread(&tid, DETACHED, do_shutdown_wait,
                              NULL, "do_shutdown_wait");
            else
                do_shutdown_now();
#if defined(_MSVC_)
    }
#endif // defined(_MSVC_)
}