Changeset 1570
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/common.c
r1498 r1570 150 150 case UM_RESCAN: 151 151 if (fAutoTile && 152 152 !fAmClosing && !fNoTileUpdate && !ParentIsDesktop(hwnd, (HWND) 0)) 153 153 PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_RESCAN, MPVOID, MPVOID); 154 154 return 0; -
trunk/dll/comp.c
r1563 r1570 76 76 23 Oct 10 GKY Add ForwardslashToBackslash function to streamline code 77 77 29 May 11 SHL Rework >65K records logic - prior fix was not quite right 78 12 Jun 11 GKY Added SleepIfNeeded in the container fill loop 78 79 79 80 ***********************************************************************/ … … 1343 1344 APIRET rc; 1344 1345 static BOOL fDone; 1346 ITIMER_DESC itdSleep = { 0 }; // 30 May 11 GKY 1345 1347 1346 1348 if (!str || !*str) { … … 1376 1378 pffbArray, ulBufBytes, &ulFindCnt, FIL_QUERYEASIZEL); 1377 1379 if (!rc) { 1380 InitITimer(&itdSleep, 500); 1378 1381 do { 1379 1382 pffbFile = pffbArray; … … 1423 1426 ulFindCnt = FilesToGet; 1424 1427 rc = xDosFindNext(hDir, pffbArray, ulBufBytes, &ulFindCnt, FIL_QUERYEASIZEL); 1428 SleepIfNeeded(&itdSleep, 1); 1425 1429 } while (!rc); 1426 1430 -
trunk/dll/dircnrs.c
r1553 r1570 1412 1412 //DosEnterCritSec(); //GKY 11-27-08 1413 1413 dcd->stopflag++; 1414 //DosExitCritSec(); 1414 //DosExitCritSec(); 1415 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 1415 1416 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 1416 1417 strcpy(dcd->directory, dcd->previous); … … 1468 1469 WinSetDlgItemText(dcd->hwndClient, DIR_SELECTED, s); 1469 1470 if (hwndStatus && 1470 1471 dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) { 1471 1472 PostMsg(dcd->hwndObject, UM_RESCAN2, MPVOID, MPVOID); 1472 1473 if ((fSplitStatus && hwndStatus2) || fMoreButtons) { … … 2313 2314 //DosEnterCritSec(); //GKY 11-27-08 2314 2315 dcd->stopflag++; 2315 //DosExitCritSec(); 2316 //DosExitCritSec(); 2317 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2316 2318 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPVOID)) { 2317 2319 //DosEnterCritSec(); //GKY 11-27-08 … … 2451 2453 //DosEnterCritSec(); // GKY 11-27-08 2452 2454 dcd->stopflag++; 2453 //DosExitCritSec(); 2455 //DosExitCritSec(); 2456 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2454 2457 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 2455 2458 strcpy(dcd->directory, dcd->previous); … … 2474 2477 strcpy(tempname1, dcd->directory); 2475 2478 AddBackslashToPath(tempname1); 2476 //if (tempname1[strlen(tempname1) - 1] != '\\')2477 // strcat(tempname1, "\\");2478 2479 strcat(tempname1, ".."); 2479 2480 DosError(FERR_DISABLEHARDERR); … … 2484 2485 strcpy(dcd->previous, dcd->directory); 2485 2486 strcpy(dcd->directory, tempname2); 2486 //DosEnterCritSec(); // GKY 11-27-082487 2487 dcd->stopflag++; 2488 //DosExitCritSec();2488 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2489 2489 if (!PostMsg(dcd->hwndObject, 2490 2490 UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 2491 2491 strcpy(dcd->directory, dcd->previous); 2492 //DosEnterCritSec();// GKY 11-27-082493 2492 dcd->stopflag--; 2494 //DosExitCritSec();2495 2493 } 2496 2494 else if (*dcd->directory) { … … 2516 2514 strcpy(dcd->directory, dcd->previous); 2517 2515 strcpy(dcd->previous, tempname); 2518 //DosEnterCritSec(); // GKY 11-27-08 2519 dcd->stopflag++; 2520 //DosExitCritSec(); 2516 dcd->stopflag++; ; 2517 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2521 2518 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 2522 2519 strcpy(dcd->directory, dcd->previous); 2523 //DosEnterCritSec(); // GKY 11-27-082524 2520 dcd->stopflag--; 2525 //DosExitCritSec();2526 2521 } 2527 2522 else if (*dcd->directory) { … … 2553 2548 strcpy(dcd->previous, dcd->directory); 2554 2549 strcpy(dcd->directory, newdir); 2555 //DosEnterCritSec(); //GKY 11-27-082556 2550 dcd->stopflag++; 2557 //DosExitCritSec();2551 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 2558 2552 if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 2559 2553 strcpy(dcd->directory, dcd->previous); 2560 //DosEnterCritSec(); // GKY 11-27-082561 2554 dcd->stopflag--; 2562 //DosExitCritSec();2563 2555 } 2564 2556 else if (*dcd->directory) { … … 3399 3391 strcpy(dcd->previous, dcd->directory); 3400 3392 strcpy(dcd->directory, pci->pszFileName); 3401 //DosEnterCritSec(); // GKY 11-27-083402 3393 dcd->stopflag++; 3403 //DosExitCritSec();3394 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 3404 3395 if (!PostMsg(dcd->hwndObject, 3405 3396 UM_RESCAN, MPVOID, MPFROMLONG(1))) { 3406 //DosEnterCritSec(); // GKY 11-27-083407 3397 dcd->stopflag--; 3408 //DosExitCritSec();3409 3398 } 3410 3399 else if (*dcd->directory) { … … 3446 3435 } 3447 3436 else { 3448 //DosEnterCritSec(); // GKY 11-27-083449 3437 dcd->stopflag++; 3450 //DosExitCritSec();3438 //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN"); 3451 3439 if (!PostMsg(dcd->hwndObject, 3452 3440 UM_RESCAN, MPVOID, MPFROMLONG(1L))) { 3453 //DosEnterCritSec(); // GKY 11-27-083454 3441 dcd->stopflag--; 3455 //DosExitCritSec();3456 3442 } 3457 3443 else if (*dcd->directory) { -
trunk/dll/dirsize.c
r1554 r1570 55 55 20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused 56 56 by temp file creation failures. 57 12 Jun 11 GKY Added SleepIfNeeded in the container fill loop 57 58 58 59 ***********************************************************************/ … … 96 97 #include "excputil.h" // xbeginthread 97 98 #include "pathutil.h" // AddBackslashToPath 99 #include "tmrsvcs.h" 98 100 99 101 typedef struct … … 267 269 PFILEFINDBUF4L pffbFile; 268 270 ULONG x; 269 271 ITIMER_DESC itdSleep = { 0 }; // 30 May 11 GKY 272 273 InitITimer(&itdSleep, 500); 270 274 while (!rc) { 271 275 … … 303 307 DosError(FERR_DISABLEHARDERR); 304 308 rc = xDosFindNext(hdir, pffbArray, ulBufBytes, &ulFindCnt, FIL_QUERYEASIZEL); 309 SleepIfNeeded(&itdSleep, 1); 305 310 } // while more found 306 311 -
trunk/dll/filldir.c
r1567 r1570 95 95 30 May 11 GKY Added SleepIfNeeded to DosFind and container load loops to improve WPS responsiveness 96 96 31 May 11 SHL Disable antique debug code in RemoveCnrItems - really speeds up container close 97 12 Jun 11 GKY Added IdleIfNeeded to the container "free" loops to improve system 98 responsiveness when closing containers with large numbers of items 99 12 Jun 11 GKY Replaced SleepIfNeeded with IdleIfNeeded in the container loade loop 97 100 98 101 ***********************************************************************/ … … 986 989 &ulFindCnt, 987 990 FIL_QUERYEASIZEL); 988 //priority_normal();991 priority_normal(); 989 992 pszFileSpec[strlen(pszFileSpec) - 1] = 0; // Chop off wildcard 990 993 if (!rc) { … … 1113 1116 ulFindCnt = ulFindMax; 1114 1117 rc = xDosFindNext(hdir, paffbFound, ulBufBytes, &ulFindCnt, FIL_QUERYEASIZEL); 1115 //priority_normal();1118 priority_normal(); 1116 1119 if (rc) 1117 1120 DosError(FERR_DISABLEHARDERR); … … 1130 1133 goto Abort; 1131 1134 1135 InitITimer(&itdSleep, 500); 1132 1136 pci = NULL; 1133 1137 ullTotalBytes = 0; … … 1169 1173 pffbFile = (PFILEFINDBUF4L)((PBYTE)pffbFile + sizeof(FILEFINDBUF4L)); 1170 1174 1175 if (!IdleIfNeeded(&itdSleep, 30)) { 1176 for (x = x+1; x < cAffbTotal; x++) { 1177 ullBytes = FillInRecordFromFFB(hwndCnr, pci, pszFileSpec, 1178 pffbFile, partial, dcd); 1179 pci = (PCNRITEM) pci->rc.preccNextRecord; 1180 ullTotalBytes += ullBytes; 1181 if (dcd) { 1182 dcd->totalfiles = x; 1183 dcd->ullTotalBytes = ullTotalBytes; 1184 } 1185 pffbFile = (PFILEFINDBUF4L)((PBYTE)pffbFile + sizeof(FILEFINDBUF4L)); 1186 if (pci == NULL) { 1187 priority_normal(); 1188 InitITimer(&itdSleep, 500); 1189 break; 1190 } 1191 } 1192 } 1193 1171 1194 if (pci == NULL && ulRecsToInsert) { 1172 1195 memset(&ri, 0, sizeof(RECORDINSERT)); … … 1195 1218 } 1196 1219 } 1197 SleepIfNeeded(&itdSleep, 1); 1198 } 1220 //SleepIfNeeded(&itdSleep, 1); 1221 } 1222 priority_normal(); 1199 1223 if (ok) { 1200 1224 ullReturnBytes += ullTotalBytes; … … 1985 2009 FreeCnrItemData(pci); 1986 2010 pci = pciNext; 1987 SleepIfNeeded(&itdSleep, 1); 1988 } 1989 2011 if (!IdleIfNeeded(&itdSleep, 30)) { 2012 for (usCount = usCount + 1; pci; usCount++) { 2013 pciNext = (PCNRITEM) pci->rc.preccNextRecord; 2014 FreeCnrItemData(pci); 2015 pci = pciNext; 2016 } 2017 break; 2018 } 2019 } 2020 priority_normal(); 2021 DosPostEventSem(CompactSem); 1990 2022 if (usCount) { 1991 2023 if (!WinSendMsg(hwnd, CM_FREERECORD, MPFROMP(&pci), MPFROMSHORT(usCount))) { … … 2045 2077 if (remaining && --remaining == 0) 2046 2078 break; 2047 SleepIfNeeded(&itdSleep, 1); 2048 } 2079 if (!IdleIfNeeded(&itdSleep, 30)) { 2080 while (pci) { 2081 FreeCnrItemData(pci); 2082 pci = (PCNRITEM)pci->rc.preccNextRecord; 2083 if (remaining && --remaining == 0) 2084 break; 2085 } 2086 } 2087 } 2088 priority_normal(); 2089 DosPostEventSem(CompactSem); 2049 2090 } 2050 2091 } -
trunk/dll/makelist.c
r1210 r1570 16 16 29 Feb 08 GKY Use xfree where appropriate 17 17 17 Jul 08 SHL Add SetListOwner for Fortify support 18 12 Jun 11 GKY Added IdleIfNeeded to the freelist loop to improve system 19 responsiveness when freeing lists with large numbers of items 18 20 19 21 ***********************************************************************/ … … 36 38 #include "wrappers.h" // xfree 37 39 #include "fortify.h" // 06 May 08 SHL 40 #include "tmrsvcs.h" // ITIMER_DESC 38 41 39 42 static PSZ pszSrcFile = __FILE__; … … 85 88 { 86 89 UINT x; 87 90 ITIMER_DESC itdSleep = { 0 }; 91 88 92 if (list) { 93 InitITimer(&itdSleep, 500); 89 94 for (x = 0; list[x]; x++) { 90 95 #ifdef __DEBUG_ALLOC__ … … 92 97 #endif 93 98 free(list[x]); 99 if (!IdleIfNeeded(&itdSleep, 30)) { 100 for (x = x + 1; list[x]; x++) { 101 free(list[x]); 102 } 103 break; 104 } 94 105 } 95 106 #ifdef __DEBUG_ALLOC__ … … 97 108 #endif 98 109 free(list); 99 } 100 DosPostEventSem(CompactSem); 110 priority_normal(); 111 DosPostEventSem(CompactSem); 112 } 101 113 } 102 114 -
trunk/dll/tmrsvcs.c
r1521 r1570 9 9 10 10 05 Jan 08 SHL Baseline 11 12 Jun 11 GKY Added IdleIfNeeded to the container/list fill and free loops to improve system 12 responsiveness when dealing with large numbers of items 11 13 12 14 ***********************************************************************/ … … 107 109 } 108 110 109 #pragma alloc_text(TMRSVCS,InitITimer,IsITimerExpired,SleepIfNeeded) 111 ULONG IdleIfNeeded(ITIMER_DESC *pitd, LONG delta) 112 { 113 APIRET rc; 114 115 if (IsITimerExpired(pitd)) { 116 rc = DosSetPriority(PRTYS_THREAD,PRTYC_IDLETIME,delta,0L); 117 InitITimer(pitd, 0); 118 return rc; 119 } 120 return 1; 121 } 122 123 #pragma alloc_text(TMRSVCS,InitITimer,IsITimerExpired,SleepIfNeeded,IdleIfNeeded) -
trunk/dll/tmrsvcs.h
r1201 r1570 30 30 BOOL IsITimerExpired(ITIMER_DESC *pitd); 31 31 VOID SleepIfNeeded(ITIMER_DESC *pitd, UINT sleepTime); 32 ULONG IdleIfNeeded(ITIMER_DESC *pitd, LONG delta); 32 33 33 34 #endif // TMRSVCS_H -
trunk/dll/treecnr.c
r1561 r1570 878 878 WinSendMsg(dcd->hwndCnr, 879 879 CM_INVALIDATERECORD, 880 880 MPVOID, MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION)); 881 881 PostMsg(dcd->hwndCnr, UM_RESCAN, MPVOID, MPVOID); 882 882 }
Note:
See TracChangeset
for help on using the changeset viewer.