On May 11, 2012, at 4:51 PM, Adam Heath wrote:

> ==
> result = parsedScripts.get(key)
> if (result == null) {
>  syncyronized (parsedScripts) {
>    result = parsedScripts.get(key)
>    if (result == null) {
>      result = genResult()
>      parsedScripts.put(key, result)
>    }
>  }
> }
> return result
> ==
> 
> DCL is about the protected resource, parsedScripts.  Please try again.
> 
> The clue here it to look at what is being protected by the
> synchronized keyword.

Just to be sure I understand: are you saying that the above code is an example 
of the DCL anti-pattern and it is wrong?

Jacopo

Reply via email to