Merge "Issue #1968 Prevent deadlock on thinclient startup" into omaha_13.4.1
Former-commit-id:2189c332b3
[formerly64352aa48b
[formerly 3cce6d362306953c927e1c02d76f3be68d80ad31]] Former-commit-id:64352aa48b
Former-commit-id:95f9c2e9dd
This commit is contained in:
commit
c28e127da9
1 changed files with 7 additions and 5 deletions
|
@ -45,6 +45,7 @@ import com.raytheon.uf.common.util.ServiceLoaderUtil;
|
|||
* to accept class parameter, deprecate old versions. Improve performance
|
||||
* of getJaxbManager().
|
||||
* Feb 07, 2013 1543 djohnson Use ServiceLoader to find how to load jaxbable classes, defaulting to SerializableManager.
|
||||
* May 01, 2013 1968 djohnson Prevent deadlock due to SerializableManager threads needing to serialize things.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -54,10 +55,6 @@ import com.raytheon.uf.common.util.ServiceLoaderUtil;
|
|||
|
||||
public final class SerializationUtil {
|
||||
|
||||
private static final IJaxbableClassesLocator jaxbableClassesLocator = ServiceLoaderUtil
|
||||
.load(IJaxbableClassesLocator.class,
|
||||
SerializableManager.getInstance());
|
||||
|
||||
private static volatile JAXBManager jaxbManager;
|
||||
|
||||
private SerializationUtil() {
|
||||
|
@ -79,7 +76,12 @@ public final class SerializationUtil {
|
|||
synchronized (SerializationUtil.class) {
|
||||
result = jaxbManager;
|
||||
if (result == null) {
|
||||
List<Class<ISerializableObject>> jaxbClasses = jaxbableClassesLocator
|
||||
// This cannot be eagerly created as
|
||||
// SerializableManager.getInstance() spawns threads which
|
||||
// were causing a deadlock
|
||||
List<Class<ISerializableObject>> jaxbClasses = ServiceLoaderUtil
|
||||
.load(IJaxbableClassesLocator.class,
|
||||
SerializableManager.getInstance())
|
||||
.getJaxbables();
|
||||
jaxbManager = result = new JAXBManager(
|
||||
jaxbClasses.toArray(new Class[jaxbClasses.size()]));
|
||||
|
|
Loading…
Add table
Reference in a new issue