The MS compiler does not allow thread local variables in the DLL interface. So, this change wraps the thread local variables with get functions that return a reference to the thread local variables.