{"shas":[["b795fe8f87a28db4458388c09e45e310247e3f0f","36296926f642c5addfd9d5348d360e82344a6560@ximian.com","Implemented fast version of ThreadLocal<T>.\n\nThis patchset implements a fast version of ThreadLocal<T> by reusing the code from\nthe implementation of the ThreadStatic attribute. The tls slots are cleaned up\non Dispose (or Finalize) instead of during appdomain shutdown.\nSince C# doesn't allow us to define an icall that returns a T& or a T* type, a JIT\nhack is used: every load field address instruction for the tlsdata field in\nThreadLocal<T> is intercepted and trasformed into a tls access by using the tls_offset\nfield from the same ThreadLocal<T> instance. So, while the C# code looks like\nit accesses and changes an instance field, under the hood it will access the tls\nstorage.\nThe end result is that this is 5-6 times faster than the previous code, 10-15%\nfaster than using Thread.GetData () (when used with references).\nThis implementation also fixes a number of issues with disposing and with\nper-thread initializers throwing an exception.","Paolo Molaro"]],"repo":"mono/mono","actor":"illupus","ref":"refs/heads/master","size":1,"head":"b795fe8f87a28db4458388c09e45e310247e3f0f","actor_gravatar":"674bf12134e1b7a00f0ddf4a599da4ee","push_id":25780203}