This project has moved and is read-only. For the latest updates, please go here.

DoSynchronously bug

Dec 23, 2010 at 8:22 AM

In this code

        public bool DoSynchronously(Action action, TimeSpan timeout)
            Contract.Requires(action != null);

            using (var evt = new ManualResetEvent(false))
                this.dispatcher.QueueAction(() => { action(); evt.Set(); });
                return evt.WaitOne(timeout);

the event could timeout and be disposed before the dispatcher thread sets it in the delegate.

You don't appear to have any unit tests for DoSynchronously.


Dec 23, 2010 at 2:38 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.