diff --git a/Assets/Generation/GenerationQueue.cs b/Assets/Generation/GenerationQueue.cs index 875f8c8..80e41e2 100644 --- a/Assets/Generation/GenerationQueue.cs +++ b/Assets/Generation/GenerationQueue.cs @@ -21,7 +21,14 @@ public class GenerationQueue{ private int _exceptionCount = 0; public GenerationQueue(World World){ - new Thread (Start).Start (); + bool useThreadPool = false; + + if (useThreadPool) { + ThreadPool.QueueUserWorkItem ( new WaitCallback( delegate(object state) + { Start(); }) ); + }else{ + new Thread (Start).Start (); + } this._world = World; } diff --git a/Assets/Generation/MeshQueue.cs b/Assets/Generation/MeshQueue.cs index 548a7b7..0908447 100644 --- a/Assets/Generation/MeshQueue.cs +++ b/Assets/Generation/MeshQueue.cs @@ -25,7 +25,14 @@ public class MeshQueue private int _exceptionCount = 0; public MeshQueue(World World){ - new Thread (Start).Start (); + bool useThreadPool = false; + + if (useThreadPool) { + ThreadPool.QueueUserWorkItem ( new WaitCallback( delegate(object state) + { Start(); }) ); + } else { + new Thread (Start).Start (); + } this._player = World.Player; this._world = World; }