Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "synchronized" to reentrant lock for virtual-threads #3014

Closed
wants to merge 4 commits into from

Conversation

omercelikceng
Copy link
Contributor

invoke and getObject method in BindableProxyFactory class
setDelegate and unbind method in LateBinding(in BindingService) class
addOutputBinding, getOutputs and unbindOutputs method in DynamicDestinationsBindable class
createConsumerFactory method in KafkaBinderMetrics class
addMetrics method in KafkaStreamsBinderMetrics class
provisionSuperStream, addToAutoDeclareContext and cleanAutoDeclareContext method in RabbitExchangeQueueProvisioner class
register method in ServerController class

were made thread-safe using ReentrantLock. This commit ensures that the method is friendly for virtual threads to avoid blocking and pinning. The lock is acquired at the beginning of the method and released in a finally block to ensure it is always released, even if an exception occurs.

@olegz
Copy link
Contributor

olegz commented Oct 7, 2024

Merged

@olegz olegz closed this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants