File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -882,7 +882,18 @@ defmodule Mix.Project do
882
882
end
883
883
end
884
884
885
- @ doc false
885
+ @ doc """
886
+ Acquires a lock on the project build path and runs the given function.
887
+
888
+ When another process (across all OS processes) is holding the lock,
889
+ a message is printed and this call blocks until the lock is acquired.
890
+ This function can also be called if this process already has the
891
+ lock. In such case the function is executed immediately.
892
+
893
+ This lock is primarily useful for compiler tasks that alter the build
894
+ artifacts to avoid conflicts with a concurrent compilation.
895
+ """
896
+ @ spec with_build_lock ( keyword , ( -> term ( ) ) ) :: term ( )
886
897
def with_build_lock ( config \\ config ( ) , fun ) do
887
898
# To avoid duplicated compilation, we wrap compilation tasks, such
888
899
# as compile.all, deps.compile, compile.elixir, compile.erlang in
You can’t perform that action at this time.
0 commit comments