Cache the ThreadId - as this is called many times and is a large source of garbage.