示例#1
0
void cm_DaemonShutdown(void)
{
    int i;
    DWORD code;

    daemon_ShutdownFlag = 1;

    /* wait for shutdown */
    for ( i=0; i<cm_nDaemons; i++) {
        osi_Wakeup((LONG_PTR) &cm_bkgListpp[i]);
        if (cm_BkgDaemon_ShutdownEvent[i])
            code = thrd_WaitForSingleObject_Event(cm_BkgDaemon_ShutdownEvent[i], INFINITE);
    }

    if (cm_Daemon_ShutdownEvent)
        code = thrd_WaitForSingleObject_Event(cm_Daemon_ShutdownEvent, INFINITE);

    if (cm_LockDaemon_ShutdownEvent)
        code = thrd_WaitForSingleObject_Event(cm_LockDaemon_ShutdownEvent, INFINITE);

#if 0
    /*
     * Do not waste precious time waiting for the ipaddr daemon to shutdown.
     * When it does it means we have lost our network connection and we need
     * it during cache shutdown in order to notify the file servers that this
     * client is giving up all callbacks.
     */
    if (cm_IPAddrDaemon_ShutdownEvent)
        code = thrd_WaitForSingleObject_Event(cm_IPAddrDaemon_ShutdownEvent, INFINITE);
#endif
}
示例#2
0
void RpcShutdown(void)
{
    RpcMgmtStopServerListening(NULL);

    if (rpc_ShutdownEvent != NULL) {
        thrd_WaitForSingleObject_Event(rpc_ShutdownEvent, INFINITE);
        CloseHandle(rpc_ShutdownEvent);
    }
}
示例#3
0
void cm_DaemonShutdown(void)
{
    int i;
    DWORD code;

    daemon_ShutdownFlag = 1;
    osi_Wakeup((LONG_PTR) &cm_bkgListp);

    /* wait for shutdown */
    if (cm_Daemon_ShutdownEvent)
        code = thrd_WaitForSingleObject_Event(cm_Daemon_ShutdownEvent, INFINITE); 

    for ( i=0; i<cm_nDaemons; i++) {
        if (cm_BkgDaemon_ShutdownEvent[i])
            code = thrd_WaitForSingleObject_Event(cm_BkgDaemon_ShutdownEvent[i], INFINITE);
    }

    if (cm_IPAddrDaemon_ShutdownEvent)
        code = thrd_WaitForSingleObject_Event(cm_IPAddrDaemon_ShutdownEvent, INFINITE);
}