summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index a825f139a..cdd8562a3 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -148,6 +148,19 @@ function sandbox_core_project.directory()
return project.directory()
end
+-- get the filelock of the whole project directory
+function sandbox_core_project.filelock()
+ local filelock = sandbox_core_project._FILELOCK
+ if filelock == nil then
+ filelock = io.openlock(path.join(config.directory(), "project.lock"))
+ if not filelock then
+ raise("cannot create the project lock!")
+ end
+ sandbox_core_project._FILELOCK = filelock
+ end
+ return filelock
+end
+
-- get the project mtimes
function sandbox_core_project.mtimes()
return project.mtimes()