You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Cenek Rauscher (JIRA)" <de...@velocity.apache.org> on 2010/01/05 10:58:55 UTC

[jira] Issue Comment Edited: (VELOCITY-750) org.apache.velocity.runtime.RuntimeInstance initialization is not ThreadSafe

    [ https://issues.apache.org/jira/browse/VELOCITY-750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796600#action_12796600 ] 

Cenek Rauscher edited comment on VELOCITY-750 at 1/5/10 9:58 AM:
-----------------------------------------------------------------

I think that "Double Checked Locking" is not main problem in this bug (but anyway you should also fix it). Main problem is using "initialized" and "initializing" fields. When initialization is started (synchronized init() method), "initializing" is set to true and requireInitialization() method not wait when initialization is done. I think that using both fields is incorrect - at least in requireInitialization() method.

      was (Author: cenek.rauscher):
    I think that "Double Checked Locking" is not main problem in this bug (but anyway you should also fix it). Main problem is using "initialized" and "initializing" fields. When initialization is started (synchronized init() method), "initializing" is set to true and requireInitialization() method return false (even if initialization is not done). I think that using both fields is incorrect - at least in requireInitialization() method.
  
> org.apache.velocity.runtime.RuntimeInstance initialization is not ThreadSafe
> ----------------------------------------------------------------------------
>
>                 Key: VELOCITY-750
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-750
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2, 1.6.x
>         Environment: Vista, Java 1.6
>            Reporter: Cenek Rauscher
>             Fix For: 1.6.x, 1.7, 2.0
>
>
> Two threads call Velocity.evaluate() method.
> Call RuntimeInstance.parse() and requireInitialization() method.
> One thread trying make initialization, set "initializing" to true and the other thread does not wait until initialization is done and go on.
> At next line Parser parser = (Parser) parserPool.get() is NullPointerException thrown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org