rhuan080 commented on PR #9332:
URL: https://github.com/apache/camel/pull/9332#issuecomment-1426811738

   Hi @essobedo, thank you for reviewing the PR.
   
   I have changed the synchronized block to lock. Now the evaluate method tries 
to get the ReadLock that does not block the thread for multiple ReadLock. The 
`init` method is using the WriteLock, thus the `evaluate` method is blocked 
only in case of a WriteLock on `init` method. It avoids the `evaluate` method 
to be blocked unnecessarily. 
   
   I think we should develop this method as thread-safe, as it is cached and 
can be used in a multithreaded task (like parallel or some internal multithread 
task). Thus, to avoid an issue now or in future, I think it should be immutable 
or thread-safe


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to