Commit a8d47eae authored by Aurelien Pupier's avatar Aurelien Pupier
Browse files

try to fix potential deadlock with sp_bar_builder

parent ead4e8d4
...@@ -101,8 +101,6 @@ public class Repository implements IRepository, IJavaContainer { ...@@ -101,8 +101,6 @@ public class Repository implements IRepository, IJavaContainer {
private static final String CLASS = "class"; private static final String CLASS = "class";
private static final String BONITA_HOME_NAME = "bonita_home";
private final IProject project; private final IProject project;
private SortedMap<Class<?>, IRepositoryStore<? extends IRepositoryFileStore>> stores; private SortedMap<Class<?>, IRepositoryStore<? extends IRepositoryFileStore>> stores;
...@@ -119,6 +117,8 @@ public class Repository implements IRepository, IJavaContainer { ...@@ -119,6 +117,8 @@ public class Repository implements IRepository, IJavaContainer {
private final ProjectClasspathFactory bonitaBPMProjectClasspath; private final ProjectClasspathFactory bonitaBPMProjectClasspath;
private boolean isLoaded = false;
public Repository(final IWorkspace workspace, public Repository(final IWorkspace workspace,
final IProject project, final IProject project,
final ExtensionContextInjectionFactory extensionContextInjectionFactory, final ExtensionContextInjectionFactory extensionContextInjectionFactory,
...@@ -286,9 +286,11 @@ public class Repository implements IRepository, IJavaContainer { ...@@ -286,9 +286,11 @@ public class Repository implements IRepository, IJavaContainer {
stores.clear(); stores.clear();
stores = null; stores = null;
} }
isLoaded = false;
} }
protected synchronized void initRepositoryStores(final IProgressMonitor monitor) { protected synchronized void initRepositoryStores(final IProgressMonitor monitor) {
isLoaded = false;
if (stores == null || stores.isEmpty()) { if (stores == null || stores.isEmpty()) {
disableBuild(); disableBuild();
stores = new TreeMap<Class<?>, IRepositoryStore<? extends IRepositoryFileStore>>(new Comparator<Class<?>>() { stores = new TreeMap<Class<?>, IRepositoryStore<? extends IRepositoryFileStore>>(new Comparator<Class<?>>() {
...@@ -317,6 +319,7 @@ public class Repository implements IRepository, IJavaContainer { ...@@ -317,6 +319,7 @@ public class Repository implements IRepository, IJavaContainer {
} }
} }
} }
isLoaded = true;
} }
private boolean migrationEnabled() { private boolean migrationEnabled() {
...@@ -731,7 +734,7 @@ public class Repository implements IRepository, IJavaContainer { ...@@ -731,7 +734,7 @@ public class Repository implements IRepository, IJavaContainer {
@Override @Override
public boolean isLoaded() { public boolean isLoaded() {
return stores != null && !stores.isEmpty(); return isLoaded;
} }
public IScopeContext getScopeContext() { public IScopeContext getScopeContext() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment