commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] Commented: (LANG-501) Add support for background initialization
Date Mon, 04 May 2009 23:49:30 GMT


Sebb commented on LANG-501:

Not sure why getExternalExecutor() is synchronized whereas setExternalExecutor() is not. 
Surely the set method should be synch., especially since the field is documented as @GuardedBy("this")
- as is future.

If the externalExecutor could be made final - e.g. by dropping the setExternalExecutor() method
- then the synch. would not be needed (assuming ExecutorService is immutable).

The method fetchCurrentExecutor() fetches currentExecutor twice and writes it once, but is
not synchronized, and is not thread-safe. needs to synchronize the code in the finally clause otherwise it
may not see the correct value of externalExecutor.

> Add support for background initialization
> -----------------------------------------
>                 Key: LANG-501
>                 URL:
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Oliver Heger
>            Priority: Minor
>             Fix For: 3.0
>         Attachments: BackgroundInitializer.patch
> This is a suggestion to add a {{BackgroundInitializer}} class that  allows initializing
an object in a background task. {{BackgroundInitializer}} is a thin wrapper around a {{java.util.concurrent.Future}}
object and uses an {{ExecutorService}} for starting a background task that performs initialization.

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

View raw message