Skip to content

Conversation

@zspitzer
Copy link
Member

@zspitzer zspitzer force-pushed the LDEV-5881-java-25-scopedValues branch from b2bebec to 3c73d6e Compare October 29, 2025 20:08
@zspitzer
Copy link
Member Author

re: Removal of InheritableThreadLocal

Support During the migration from ThreadLocal to ScopedValue, the pcThreadLocalInheritable (InheritableThreadLocal) was removed because ScopedValue does not support automatic inheritance to child threads like InheritableThreadLocal did.

The INHERIT_ENABLED flag was set to false, and inheritance functionality was intentionally disabled. As part of the performance optimization cleanup, we removed the now-dead "pc from parent thread" code blocks that were checking pcThreadLocalInheritable.get() - these blocks had been reduced to pc = null;

if (pc != null) after the variable was removed, making them unreachable dead code. Child threads that need access to a parent's PageContext must now explicitly pass it or establish a new ScopedValue scope using ScopedValue.where(ThreadLocalPageContext.CURRENT, pc).call(() -> {}). This is a more explicit and safer pattern for virtual threads.

@zspitzer zspitzer force-pushed the LDEV-5881-java-25-scopedValues branch from 73acd28 to b7a142f Compare October 29, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant