I'd like to run a TPL Task
under a given culture. I have an Action
and a CultureInfo
and want to run those in a Task
. This is for unit testing purposes.
I could set Thread.CurrentCulture
inside of the task but my concern is that the culture will "leak" and affect other thread pool work items that will non-deterministically reuse the current thread.
What's the proper way to do this?