Changeset 1877 for trunk/dll/flesh.c
- Timestamp:
 - Oct 11, 2015, 11:43:27 PM (10 years ago)
 - File:
 - 
      
- 1 edited
 
- 
          
  trunk/dll/flesh.c (modified) (20 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/dll/flesh.c
r1876 r1877 95 95 96 96 static PCSZ pszFleshFocusPath; // 2015-08-20 SHL 97 #if 0 98 BOOL fNoFleshDbgMsg; // 2015-08-09 SHL FIXME to be gone 99 #endif 97 100 98 #pragma data_seg(GLOBAL1) 101 99 ULONG NoBrokenNotify; … … 200 198 ri.cRecordsInsert = 1; 201 199 ri.fInvalidateRecord = FALSE; 202 #if 0 // 2015-08-03 SHL FIXME debug203 if (pciL->pszFileName == NullStr)204 DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pciL, pciL->pszFileName); // 2015-08-03 SHL FIXME debug205 #endif206 200 if (!WinSendMsg(hwndCnr, 207 201 CM_INSERTRECORD, MPFROMP(pciL), MPFROMP(&ri))) … … 250 244 return FALSE; 251 245 252 #if 0 // 2015-08-03 SHL FIXME debug253 if (!fNoFleshDbgMsg) {254 DbgMsg(pszSrcFile, __LINE__, "Flesh %s pciParent %p pszFileName %p",255 pciParent && (INT)pciParent != -1 && pciParent->pszFileName ?256 pciParent->pszFileName : "(null)",257 pciParent,258 pciParent && (INT)pciParent != -1 ? pciParent->pszFileName : (PVOID)-1); // 2015-08-03 SHL FIXME debug259 }260 #endif261 // 2015-08-06 SHL allow pciL -1262 // 2015-08-06 SHL FIXME to not need pszFileName check263 246 if (!pciParent->fleshed) { 264 247 pciL = (PCNRITEM)WinSendMsg(hwndCnr, … … 271 254 // 2015-08-06 SHL FIXME to ensure this can not happen 272 255 if (!*pciL->pszFileName || !strcmp(pciL->pszFileName, NullStr)) 273 Runtime_Error(pszSrcFile, __LINE__, "Flesh called with pci %p pszFileName (null)", pciL); 274 #if 0 275 if (!fNoFleshDbgMsg) 276 DbgMsg(pszSrcFile, __LINE__, "Flesh RemoveCnrItems() pciL %p \"%s\"", 277 pciL, 278 pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-04 SHL FIXME debug 279 // Assume refernces to pciL already removed from work list 280 #endif 256 Runtime_Error(pszSrcFile, __LINE__, "Flesh called with pci %p pszFileName (null)", 257 pciL); 281 258 } 282 259 dcd = INSTDATA(hwndCnr); … … 318 295 if (!pciParent || !hwndCnr) 319 296 return; 320 #if 0321 if (!fNoFleshDbgMsg)322 DbgMsg(pszSrcFile, __LINE__, "UnFlesh pciParent %p pszFileName \"%s\"", pciParent, pciParent->pszFileName ? pciParent->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug323 #endif324 297 for (;;) { 325 298 pciL = (PCNRITEM)WinSendMsg(hwndCnr, … … 328 301 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 329 302 if (!pciL || (INT)pciL == -1) 330 break; // Done 331 #if 0 332 if (!fNoFleshDbgMsg) 333 DbgMsg(pszSrcFile, __LINE__, "UnFlesh RemoveCnrItems() pciL %p \"%s\"", pciL, pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug 334 #endif 303 break; 335 304 RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE); 336 305 removed = TRUE; … … 383 352 static BOOL brokenlan = FALSE, isbroken = FALSE; 384 353 385 //DbgMsg(pszSrcFile, __LINE__,"Stubby pciParent %p", pciParent);386 354 if (!pciParent || (INT)pciParent == -1 || !*pciParent->pszFileName 387 355 || pciParent->pszFileName == NullStr || !hwndCnr) 388 356 return FALSE; 389 #if 0390 if (!fNoFleshDbgMsg)391 DbgMsg(pszSrcFile, __LINE__, "Stubby pciParent %p pszFileName %s", pciParent, pciParent->pszFileName); // 2015-08-03 SHL FIXME debug392 #endif393 357 // Build wildcard 394 358 len = strlen(pciParent->pszFileName); … … 402 366 if (!isalpha(*wildcard) || wildcard[1] != ':' || wildcard[2] != '\\') { 403 367 MakeFullName(wildcard); 404 //DbgMsg(pszSrcFile, __LINE__, "Stubby MakeFullName returned %s", wildcard); // 2015-08-19 SHL FIXME debug405 368 } 406 369 drvNum = toupper(*pciParent->pszFileName) - 'A'; … … 435 398 436 399 fl = includefiles ? FILE_DIRECTORY : MUST_HAVE_DIRECTORY; 437 438 //DbgMsg(pszSrcFile, __LINE__, "Stubby DosFindFirst(%s)", wildcard); // 2015-08-19 SHL FIXME debug439 440 400 rc = DosFindFirst(wildcard, 441 401 &hDir, … … 635 595 ri.cRecordsInsert = 1; 636 596 ri.fInvalidateRecord = TRUE; 637 #if 0 // 2015-08-03 SHL FIXME debug638 if (pci->pszFileName == NullStr)639 DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD %p \"%s\" %.255s", pci, pci->pszFileName, pffb->achName);640 #endif641 597 if (!WinSendMsg(hwndCnr, 642 598 CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) { 643 599 // Assume busy and try again 644 DosSleep(50); //05 Aug 07 GKY 100600 DosSleep(50); 645 601 WinSetFocus(HWND_DESKTOP, hwndCnr); 646 602 if (WinIsWindow((HAB)0, hwndCnr)) { 647 #if 0648 if (!fNoFleshDbgMsg) {649 // 2015-08-03 SHL FIXME debug650 //if (pci->pszFileName == NullStr)651 // DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pci, pci->pszFileName); // 2015-08-03 SHL FIXME debug652 }653 #endif654 603 if (!WinSendMsg(hwndCnr, 655 604 CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) { … … 734 683 if (!item) 735 684 break; 736 //DbgMsg(pszSrcFile, __LINE__, "DeleteStaleFleshWorkListItems deleting %p %s", pci, pci->pszFileName ? pci->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug737 685 List2Delete(&FleshWorkList, item); 738 686 xfree(item, pszSrcFile, __LINE__); … … 748 696 */ 749 697 750 #ifndef AddFleshWorkRequest // 2015-08-03 SHL FIXME debug 698 751 699 BOOL AddFleshWorkRequest(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action) 752 #else753 BOOL AddFleshWorkRequestDbg(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action, PCSZ pszSrcFile_, UINT uSrcLineNo)754 #endif755 700 { 756 701 PFLESHWORKITEM item = xmallocz(sizeof(FLESHWORKITEM), pszSrcFile, __LINE__); … … 762 707 return FALSE; 763 708 764 // 2015-08-03 SHL FIXME debug765 #if 0 // 2015-08-13 SHL FIXME to be gone766 {767 static PSZ itemNames[] = {768 "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh"769 };770 771 # ifdef AddFleshWorkRequest772 if (!pci || (INT)pci == -1) {773 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p by %s:%u",774 itemNames[item->action],775 pci,776 pszSrcFile_, uSrcLineNo);777 }778 else if (!pci->pszFileName) {779 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p pszFileName (null) by %s:%u",780 itemNames[item->action],781 pci,782 pszSrcFile_, uSrcLineNo);783 }784 else if (!fNoFleshDbgMsg) {785 DbgMsg(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName %s by %s:%u",786 itemNames[item->action],787 pci,788 pci->pszFileName,789 pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug790 }791 #else792 if (!pci || (INT)pci == -1) {793 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p",794 itemNames[item->action],795 pci);796 }797 else if (!pci->pszFileName) {798 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName (null)",799 itemNames[item->action],800 pci);801 }802 else if (!fNoFleshDbgMsg) {803 DbgMsg(pszSrcFile, __LINE__, "AddFleshWorkRequest action %s pci %p pszFileName %s",804 itemNames[item->action],805 pci,806 pci->pszFileName); // 2015-08-03 SHL FIXME debug807 }808 #endif809 }810 #endif811 709 812 710 xDosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT); … … 858 756 */ 859 757 860 #ifndef WaitFleshWorkListEmpty // 2015-08-03 SHL FIXME debug 758 861 759 VOID WaitFleshWorkListEmpty(PCSZ pszDirName, ULONG ulSleep) 862 #else863 VOID WaitFleshWorkListEmptyDbg(PCSZ pszDirName, ULONG ulSleep, PCSZ pszSrcFile_, UINT uSrcLineNo_)864 #endif865 760 { 866 761 APIRET rc; … … 872 767 INT rcCount = 0; 873 768 874 if (tid == 1 || tid == tidFleshWorkListThread) { 875 # ifdef WaitFleshWorkListEmpty 876 Runtime_Error(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist %sempty by tid %u at %s:%u", IsFleshWorkListEmpty() ? "" : "not ", tid, pszSrcFile_, uSrcLineNo_); 877 # else 769 if (tid == 1 || tid == tidFleshWorkListThread) { // 11 Oct 15 GKY Fixme did we intend to keep this 878 770 Runtime_Error(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called by tid %u", tid); 879 # endif880 771 return; // Avoid hang 881 772 } 882 #if 0883 else if (IsFleshWorkListEmpty()) {884 # ifdef WaitFleshWorkListEmpty885 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist empty at %s:%u", pszSrcFile_, uSrcLineNo_);886 # else887 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list empty");888 # endif889 }890 #endif891 892 773 // Can not wait if call from thread 1 or FleshWorkListThread 893 774 for (waited = FALSE; !IsFleshWorkListEmpty(); waited = TRUE) { 894 895 #if 0 // 2015-08-19 SHL FIXME debug896 # ifdef WaitFleshWorkListEmpty897 if (!fNoFleshDbgMsg)898 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty by %s:%u", pszSrcFile_, uSrcLineNo_); // 2015-08-07 SHL FIXME debug899 # else900 if (!fNoFleshDbgMsg)901 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty"); // 2015-08-07 SHL FIXME debug902 # endif903 #endif // 2015-08-19 SHL FIXME debug904 905 775 // 2015-08-13 SHL 906 776 if (fAmQuitting) … … 965 835 if (pszOld) 966 836 xfree((PVOID)pszOld, pszSrcFile, __LINE__); 967 //DbgMsg(pszSrcFile, __LINE__, "SetFleshFocusPath focus path set to %s", pszFleshFocusPath); // 2015-08-03 SHL FIXME debug968 969 837 } 970 838 … … 1025 893 if (!item) { 1026 894 ULONG ul; 1027 #if 01028 if (!fNoFleshDbgMsg)1029 DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread work list empty - waiting"); // 2015-08-03 SHL FIXME debug1030 #endif1031 895 xDosWaitEventSem(hevFleshWorkListChanged, SEM_INDEFINITE_WAIT); 1032 896 xDosResetEventSem(hevFleshWorkListChanged, &ul); 1033 #if 01034 if (!fNoFleshDbgMsg)1035 DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread work hev posted"); // 2015-08-03 SHL FIXME debug1036 #endif1037 897 continue; 1038 898 } 1039 899 1040 if (WinIsWindow((HAB)0, item->hwndCnr)) { 1041 #if 0 // 2015-08-07 SHL FIXME debug 1042 { 1043 static PSZ itemNames[] = { 1044 "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh" 1045 }; 1046 1047 PCNRITEM pci = item->pci; 1048 if (!fNoFleshDbgMsg) { 1049 DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread action %s pci %p pszFileName %s", 1050 itemNames[item->action], 1051 pci, 1052 pci && (INT)pci != -1 ? 1053 (pci->pszFileName ? pci->pszFileName : "(nullname)") : 1054 "(nullpci)"); // 2015-08-03 SHL FIXME debug 1055 } 1056 } 1057 #endif 900 if (WinIsWindow((HAB)0, item->hwndCnr)) { 1058 901 1059 902 switch (item->action) { … … 1065 908 break; 1066 909 case eStubby: 1067 // DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread pci %p pszFileName %s", stubbyArgs->pci, stubbyArgs->pci->pszFileName); // 2015-08-03 SHL FIXME debug1068 910 priority_bumped(); 1069 911 Stubby(item->hwndCnr, item->pci); … … 1093 935 1094 936 ProcessDirCount++; 1095 // DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", ProcessDirCount, FixedVolume);1096 937 if (ProcessDirCount >= FixedVolume) { 1097 938 ProcessDirCount = 0; … … 1122 963 if (rc) 1123 964 return FALSE; // Give up 1124 #if 01125 /*DbgMsg is time consuming1126 define FM2_NO_FLESH_DBGMSG to suppress1127 2015-08-09 SHL FIXME to be gone1128 */1129 1130 fNoFleshDbgMsg = getenv("FM2_NO_FLESH_DBGMSG") != NULL;1131 #endif1132 965 tidFleshWorkListThread = xbeginthread(FleshWorkThread, 1133 966 65536,  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  