Is this a thread safe way to control access to a reusable resource? Is there a better way?
I'm not sure to be honest, the contained resource would be specific per thread and created upon first read so volatile may be unnecessary as I believe that's for multiple threads reading and writing to the same field.
It looks like you are trying to make a singleton version of the ThreadLocal class, unless you have a good reason I would suggest that you just use that instead.
The ThreadLocal class allows for a factory method (as a Func&lt;T&gt;) to be supplied to create a more complex object.
It depends on the type of resource you want to use in this manner, if it is a service or resource then yes an IOC may be a better option as most containers allow an instance per thread. However if you just need per thread storage of a field, then ThreadLocal is a better option. It also allows the resource to be properly disposed if required too.