/// <summary> /// Queues an action to run on a game resource, which will be run later by the game thread. /// </summary> /// <param name="action"></param> public void QueueResMod(ResAction action) { lock (ResActionQueue) { ResActionQueue.Enqueue(action); } }
public void BlockingResMod(ResAction action) { var wait = new AutoResetEvent(false); action.SetSignal(wait); lock (ResActionQueue) { ResActionQueue.Enqueue(action); } wait.WaitOne(); }