Changeset 1764 for trunk/dll


Ignore:
Timestamp:
Mar 22, 2014, 9:01:22 PM (12 years ago)
Author:
John Small
Message:

RemoveCnrItems changes:
Remove unneeded nested loop
Stop calling IdleIfNeeded after idle has been set
No call to priority_normal if idle priority was never set
Fix compile error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/filldir.c

    r1763 r1764  
    19941994{
    19951995  INT remaining = usCnt;
     1996  BOOL bIdlePrioritySet = FALSE;
     1997// #define RCI_ITEMS_PER_TIMER_CHECK (10)
     1998// 10 seems a very conservative number
     1999//   USHORT usTimerCheckCountdown       = RCI_ITEMS_PER_TIMER_CHECK;
    19962000  PCNRITEM pci;
    19972001  ITIMER_DESC itdSleep = { 0 };         // 30 May 11 GKY
     
    20212025        if (!pci)
    20222026          break;
    2023         if (remaining && --remaining == 0) '
     2027        if (remaining && --remaining == 0)
    20242028          break;
    2025         // 22 Mar 14 GKY This second loop is to avoid calling or checking if
    2026         // IdleIfNeeded has been called on loops after it has set the process to idle
    2027         if (!IdleIfNeeded(&itdSleep, 30)) {
    2028           while (pci) {
    2029             FreeCnrItemData(pci);
    2030             pci = (PCNRITEM)pci->rc.preccNextRecord;
    2031             if (remaining && --remaining == 0)
    2032               break;
    2033           } // while
    2034           break;
     2029        if (!bIdlePrioritySet /* && --usTimerCheckCountdown == 0 */) {
     2030          bIdlePrioritySet = !IdleIfNeeded(&itdSleep, 30);
     2031//           usTimerCheckCountdown = RCI_ITEMS_PER_TIMER_CHECK;
    20352032        }
    20362033      } // while
    2037       priority_normal();
     2034      if (bIdlePrioritySet)
     2035        priority_normal();
     2036
    20382037      DosPostEventSem(CompactSem);
    20392038    }
Note: See TracChangeset for help on using the changeset viewer.