4 using System.Threading;
6 using SiliconStudio.Core.Diagnostics;
8 namespace SiliconStudio.BuildEngine
19 private readonly Thread builderThread;
20 private readonly
Builder builder;
31 this.builder = builder;
33 builderThread =
new Thread(
SafeAction.
Wrap(BuilderThread)) { IsBackground =
true };
34 if (!
string.IsNullOrEmpty(name))
36 builderThread.Name = name;
45 builderThread.Start();
53 builder.CancelBuild();
54 dynamicBuildStep.NotifyNewWorkAvailable();
63 dynamicBuildStep.NotifyNewWorkAvailable();
66 private void BuilderThread()
69 builder.Root.Add(dynamicBuildStep);
70 builder.Run(Builder.Mode.Build,
true,
false);
void Dispose()
Cancels any build in progress and wait for the thread to exit.
static ThreadStart Wrap(ThreadStart action, [CallerFilePath] string sourceFilePath="", [CallerMemberName] string memberName="", [CallerLineNumber] int sourceLineNumber=0)
This class allow to run a given Builder in a new thread. It will run a single DynamicBuildStep that c...
void NotifyBuildStepAvailable()
Notify the DynamicBuildStep that a new build step is available.
DynamicBuilder(Builder builder, IBuildStepProvider buildStepProvider, string name=null)
Initializes a new instance of the DynamicBuilder class.
void Start()
Starts the thread an run the builder.
This interface describes a class that is capable of providing build steps to a DynamicBuildStep.