Source

Resharper Spell Checker / ReSpeller / Util / AsyncValue.cs

Full commit
using System;
using System.Threading;

namespace ReSpeller.Util
{
    class AsyncValue<T>
    {
        private T myValue;
 
        private readonly ManualResetEvent myReset = new ManualResetEvent(false);

        public AsyncValue(Func<T> evaluator)
        {
            new Thread(() => 
                {
                    myValue = evaluator();
                    myReset.Set();
                }).Start();
        }

        public T Value
        {
            get 
            {
                myReset.WaitOne();
                return myValue;
            }
        }
    }
}