Changeset 3203 in kBuild
- Timestamp:
- Mar 28, 2018 10:23:23 PM (7 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/dir-nt-bird.c
r3192 r3203 77 77 PKFSCACHE g_pFsCache = NULL; 78 78 /** Number of times dir_cache_invalid_missing was called. */ 79 static KU32 g_cInvalidates = 0;79 static KU32 volatile g_cInvalidates = 0; 80 80 /** Set by dir_cache_volatile_dir to indicate that the user has marked the 81 81 * volatile parts of the file system with custom revisioning and we only need to … … 651 651 * 652 652 * Used by $(dircache-ctl invalidate) 653 * @note Multi-thread safe. 653 654 */ 654 655 void dir_cache_invalid_all(void) 655 656 { 656 assert(GetCurrentThreadId() == g_idMainThread);657 657 g_cInvalidates++; 658 658 kFsCacheInvalidateAll(g_pFsCache); … … 663 663 * 664 664 * Used by $(dircache-ctl invalidate-missing) 665 * @note Multi-thread safe. 665 666 */ 666 667 void dir_cache_invalid_missing(void) 667 668 { 668 assert(GetCurrentThreadId() == g_idMainThread);669 669 g_cInvalidates++; 670 670 kFsCacheInvalidateAll(g_pFsCache); … … 675 675 * 676 676 * Used by $(dircache-ctl invalidate-missing) 677 * @note Multi-thread safe. 677 678 */ 678 679 void dir_cache_invalid_volatile(void) 679 680 { 680 assert(GetCurrentThreadId() == g_idMainThread);681 681 g_cInvalidates++; 682 682 if (g_fFsCacheIsUsingCustomRevision) -
trunk/src/kmk/w32/winchildren.c
r3202 r3203 1641 1641 1642 1642 /** 1643 * Temporary workaround for seemingly buggy kFsCache.c / dir-nt-bird.c. 1644 * 1645 * Something is not invalidated / updated correctly! 1646 */ 1647 static BOOL mkWinChildcareWorkerIsRegularFileW(PWINCHILDCAREWORKER pWorker, wchar_t const *pwszPath) 1648 { 1649 BOOL fRet = FALSE; 1650 #ifdef KMK 1651 if (utf16_regular_file_p(pwszPath)) 1652 fRet = TRUE; 1653 else 1654 #endif 1655 { 1656 /* Don't believe the cache. */ 1657 DWORD dwAttr = GetFileAttributesW(pwszPath); 1658 if (dwAttr != INVALID_FILE_ATTRIBUTES) 1659 { 1660 if (!(dwAttr & FILE_ATTRIBUTE_DIRECTORY)) 1661 { 1662 #ifdef KMK 1663 extern void dir_cache_invalid_volatile(void); 1664 dir_cache_invalid_volatile(); 1665 if (utf16_regular_file_p(pwszPath)) 1666 MkWinChildError(pWorker, 1, "kFsCache was out of sync! pwszPath=%S\n", pwszPath); 1667 else 1668 { 1669 dir_cache_invalid_all(); 1670 if (utf16_regular_file_p(pwszPath)) 1671 MkWinChildError(pWorker, 1, "kFsCache was really out of sync! pwszPath=%S\n", pwszPath); 1672 else 1673 MkWinChildError(pWorker, 1, "kFsCache is really out of sync!! pwszPath=%S\n", pwszPath); 1674 } 1675 #endif 1676 fRet = TRUE; 1677 } 1678 } 1679 } 1680 return fRet; 1681 } 1682 1683 1684 /** 1643 1685 * Tries to locate the image file, searching the path and maybe falling back on 1644 1686 * the shell in case it knows more (think cygwin with its own view of the file … … 1746 1788 } 1747 1789 1748 #ifdef KMK 1749 if (utf16_regular_file_p(pwszPath)) 1750 #else 1751 if (GetFileAttributesW(pwszPath) != INVALID_FILE_ATTRIBUTES) 1752 #endif 1790 if (mkWinChildcareWorkerIsRegularFileW(pWorker, pwszPath)) 1753 1791 { 1754 1792 *pfProbableClExe = mkWinChildIsProbableClExe(pwszPath, cwcPath + 4 - 1); … … 1764 1802 pwszPath[cwcPath - 1] = L'\0'; 1765 1803 #ifdef KMK 1766 if ( utf16_regular_file_p(pwszPath))1804 if (mkWinChildcareWorkerIsRegularFileW(pWorker, pwszPath)) 1767 1805 #endif 1768 1806 { … … 1837 1875 if (cwcComponent > 0 && cwcCombined <= MKWINCHILD_MAX_PATH) 1838 1876 { 1839 #ifndef KMK1840 DWORD dwAttribs;1841 #endif1842 1843 1877 /* Copy the component into wszPathBuf, maybe abspath'ing it. */ 1844 1878 DWORD cwcAbsPath = 0; … … 1892 1926 wszPathBuf[cwcCombined + 3] = L'\0'; 1893 1927 } 1894 #ifdef KMK 1895 if (utf16_regular_file_p(wszPathBuf)) 1896 #else 1897 dwAttribs = GetFileAttributesW(wszPathBuf); 1898 if ( dwAttribs != INVALID_FILE_ATTRIBUTES 1899 && !(dwAttribs & FILE_ATTRIBUTE_DIRECTORY)) 1900 #endif 1928 if (mkWinChildcareWorkerIsRegularFileW(pWorker, wszPathBuf)) 1901 1929 { 1902 1930 *pfProbableClExe = mkWinChildIsProbableClExe(wszPathBuf, cwcCombined + (fHasExeSuffix ? 0 : 4) - 1); … … 1907 1935 wszPathBuf[cwcCombined - 1] = L'\0'; 1908 1936 #ifdef KMK 1909 if ( utf16_regular_file_p(wszPathBuf))1937 if (mkWinChildcareWorkerIsRegularFileW(pWorker, wszPathBuf)) 1910 1938 #endif 1911 1939 {
Note:
See TracChangeset
for help on using the changeset viewer.