From 94459080c118049aba927ec0444ba5b750b7d2c9 Mon Sep 17 00:00:00 2001 From: "Shi, Steven" Date: Thu, 15 Aug 2019 22:26:21 +0800 Subject: BaseTools: Improve the file saving and copying reliability BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2079 The Basetool CopyFileOnChange() and SaveFileOnChange() functions might raise the IOError occasionally when build in Windows with multi-process and build cache enabled. The CopyFileOnChange() and SaveFileOnChange() might be invoked in multiple sub-processes simultaneously, and this patch adds global locks to sync these functions invoking which can harden their reliability. Cc: Liming Gao Cc: Bob Feng Signed-off-by: Steven Shi Reviewed-by: Bob Feng --- BaseTools/Source/Python/Common/GlobalData.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'BaseTools/Source/Python/Common/GlobalData.py') diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 9ea835314a..61327ad8f1 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -122,6 +122,8 @@ gBuildHashSkipTracking = dict() # Common dictionary to share module cache intermediate result and state gCacheIR = None +# Common lock for the module cache intermediate data +cache_lock = None # Common lock for the file access in multiple process AutoGens file_lock = None # Common dictionary to share platform libraries' constant Pcd -- cgit v1.2.3