void FILESET::Close (void) { AfsClass_Leave(); }
void SERVER::Close (void) { AfsClass_Leave(); }
DWORD WINAPI Alert_ScoutProc (LPVOID lp) { // We'll keep working forever... // for (;;) { AfsClass_Enter(); LPCELL lpCell = (g.lpiCell == NULL) ? NULL : g.lpiCell->OpenCell(); if (lpCell != NULL) { // See if our credentials have expired // CheckForExpiredCredentials(); // See if any new servers have arrived, or old servers disappeared. // lpCell->RefreshServerList(); // Check all the out-of-date servers we can find. // HENUM hEnum; for (LPSERVER lpServer = lpCell->ServerFindFirst (&hEnum); lpServer; lpServer = lpCell->ServerFindNext (&hEnum)) { LPIDENT lpiServer = lpServer->GetIdentifier(); LPOBJECTALERTS lpoa; if ( ((lpoa = Alert_GetObjectAlerts (lpiServer)) != NULL) && (lpoa->dwTickNextTest <= GetTickCount()) ) { // Okay! We've found a server that needs to be tested for // alert conditions. Do that now, and when we're done, set // its next query-time to some distance in the future. // if (lpoa->dwTickNextRefresh == 0) { if (lpoa->cTickRefresh != 0) lpoa->dwTickNextRefresh = lpoa->cTickRefresh + GetTickCount(); } else if (lpoa->dwTickNextRefresh <= GetTickCount()) { (void)lpServer->Invalidate(); (void)lpServer->RefreshAll(); lpoa->dwTickNextRefresh = lpoa->cTickRefresh + GetTickCount(); } (void)Alert_Scout_CheckServer (lpServer); } lpServer->Close(); } lpCell->Close(); } AfsClass_Leave(); // Now that we have completed a pass over the servers in this cell, // and now that we're not holding any critical sections on which // other threads would otherwise block, go to sleep for a while. // WaitForSingleObjectEx (heScoutWakeup, 45L * cmsec1SECOND, FALSE); } return 0; }
void SERVICE::Close (void) { AfsClass_Leave(); }