/// <summary>
 /// Cleanup and stop the dispatch thread.
 /// </summary>
 public void Dispose()
 {
     Wait = null;
     lock (actionsLock)
     {
         stop = true;
         Monitor.PulseAll(actionsLock);
         Stop.Fire(this);
     }
 }