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 <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Steven Shi <steven.shi@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user