Source

Resharper Spell Checker / ReSpeller / Lazy.cs

Full commit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

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

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

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