Commit 0e3b998

mo khan <mo@mokhan.ca>
2009-05-08 18:28:01
renamed thread to CurrentThread
1 parent effbc21
Changed files (1)
product
Gorilla.Commons.Infrastructure
Transactions
product/Gorilla.Commons.Infrastructure/Transactions/CurrentThread.cs
@@ -0,0 +1,14 @@
+using System.Threading;
+
+namespace Gorilla.Commons.Infrastructure.Transactions
+{
+    public class CurrentThread : IThread
+    {
+        public T provide_slot_for<T>() where T : class, new()
+        {
+            var slot = Thread.GetNamedDataSlot(GetType().FullName + typeof (T).FullName);
+            if (null == Thread.GetData(slot)) Thread.SetData(slot, new T());
+            return (T) Thread.GetData(slot);
+        }
+    }
+}
\ No newline at end of file