-
-
Notifications
You must be signed in to change notification settings - Fork 31
Theraot.Threading.TrackingThreadLocal
Alfonso J. Ramos edited this page Nov 10, 2015
·
2 revisions
This class is the tracking backend for ThreadLocal. The internal implementation uses SafeDictionary<Thread, INeedle<T>> this means that:
- The values are available after the thread to which they belong has ended.
- It is possible to iterate over the values for all the threads.
NoTrackingThreadLocal<T> in addition offers:
-
TryGetValuewill only return the value for the current thread if it has been already created. There is an overload to get the value of another thread. -
EraseValueuncreates the value for the current thread.