Commit 4916e820 authored by Petri Hintukainen's avatar Petri Hintukainen

Fix race condition in multiple getInstance() functions

parent 435399d8
......@@ -28,8 +28,8 @@ public class Status {
synchronized (Status.class) {
if (instance == null)
instance = new Status();
return instance;
}
return instance;
}
public static void shutdown() {
......
......@@ -24,8 +24,8 @@ public class StorageManager {
synchronized (StorageManager.class) {
if (instance == null)
instance = new StorageManager();
return instance;
}
return instance;
}
protected StorageManager() {
......
......@@ -40,8 +40,8 @@ public class EventManager implements ResourceServer {
synchronized (EventManager.class) {
if (instance == null)
instance = new EventManager();
return instance;
}
return instance;
}
public static void shutdown() {
......
......@@ -31,8 +31,8 @@ public class UserPreferenceManager {
synchronized (UserPreferenceManager.class) {
if (instance == null)
instance = new UserPreferenceManager();
return instance;
}
return instance;
}
public void read(Preference p) {
......
......@@ -35,8 +35,8 @@ public class BDJAppsDatabase extends AppsDatabase {
synchronized (BDJAppsDatabase.class) {
if (instance == null)
instance = new BDJAppsDatabase();
return instance;
}
return instance;
}
public int size() {
......@@ -106,5 +106,5 @@ public class BDJAppsDatabase extends AppsDatabase {
private BDJAppProxy[] appProxys = null;
private AppEntry[] appTable = null;
protected static BDJAppsDatabase instance = null;
private static BDJAppsDatabase instance = null;
}
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