Extend spinlock protection to thread ID map lookup (rather than just the map update).