ThreadLocal Goes Missing Inside StructuredTaskScope
A ThreadLocal that worked fine in a thread pool returns null the moment a virtual thread forks a subtask. Here's the mechanism, and what actually fixes it.
Core language
Errors & fixes
Apache Kafka
Relational
NoSQL & caching
Errors & fixes
Course · javahandbook.com
Oracle Interview Mastery
200 questions · 19 chapters
View course →Interview courses
A ThreadLocal that worked fine in a thread pool returns null the moment a virtual thread forks a subtask. Here's the mechanism, and what actually fixes it.