Threads werden nicht mehr im Konstruktor gestartet, um race conditions zu

vermeiden
This commit is contained in:
2014-05-01 18:10:01 +02:00
parent 9bf7abb465
commit 7ffba85903
6 changed files with 31 additions and 8 deletions

View File

@@ -17,7 +17,6 @@ namespace WorldOfPeacecraft
public Gui ()
{
AllocConsole();
InitializeComponents();
}
public void SetBackend (IBackend backend)
@@ -25,6 +24,13 @@ namespace WorldOfPeacecraft
Backend = backend;
}
protected override void OnLoad (EventArgs e)
{
base.OnLoad (e);
InitializeComponents ();
Backend.StartThreads ();
}
public void InitializeComponents ()
{
this.SuspendLayout();
@@ -40,7 +46,6 @@ namespace WorldOfPeacecraft
this.Controls.Add(Board);
this.ResumeLayout();
this.PerformLayout();
}
protected override void OnClosing (System.ComponentModel.CancelEventArgs e)

View File

@@ -10,6 +10,8 @@ namespace WorldOfPeacecraft
IEnumerable<IPositionable> GetDragons();
void StartThreads();
void Stop();
}
}