public List <QueuedInput> GetInputQueue() { QueueLock.WaitOne(); var r = Queued; Queued = new List <QueuedInput>(); QueueLock.ReleaseMutex(); return(r); }
public override void Construct() { Root.RegisterForUpdate(this); OnUpdate = (sender, time) => { MessageLock.WaitOne(); if (NeedsInvalidated) { this.Invalidate(); } NeedsInvalidated = false; MessageLock.ReleaseMutex(); }; }
/// <summary> /// 释放资源 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private static void OnExit(object sender, EventArgs args) { // releases the Mutex once .. __Mu.ReleaseMutex(); // releases all resources .. __Mu.Close(); }
public override void Construct() { Root.RegisterForUpdate(this); OnUpdate = (sender, time) => { MessageLock.WaitOne(); if (NeedsInvalidated) { this.Invalidate(); } NeedsInvalidated = false; MessageLock.ReleaseMutex(); }; Lines.Add(""); TextGrid = AddChild(new TextGrid { AutoLayout = AutoLayout.DockFill, Font = "monofont", TextSize = GameSettings.Default.ConsoleTextSize, }) as TextGrid; }