.NET ThreadStaticAttribute Class

Indicates that the value of a static field is unique for each thread.

 

  [ThreadStatic]
   private static Singlton myInstanace;

   public static Singlton Instance
  {
      get 
      {
           myInstanace = new Singlton();
           return myInstanace;
      }
}

 

posted @ 2008-10-08 10:46  许晓光  阅读(364)  评论(0)    收藏  举报