mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-29 12:37:40 +01:00
Made API Services volatile to avoid thread visibility issues
This commit is contained in:
parent
96b9ad8f9b
commit
12a264b1ea
@ -16,8 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.djrapitops.plan.capability;
|
package com.djrapitops.plan.capability;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,6 +64,6 @@ public interface CapabilityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ListHolder {
|
class ListHolder {
|
||||||
static List<Consumer<Boolean>> ENABLE_LISTENERS = new ArrayList<>();
|
volatile static List<Consumer<Boolean>> ENABLE_LISTENERS = new CopyOnWriteArrayList<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ public interface ResolverService {
|
|||||||
List<Resolver> getResolvers(String target);
|
List<Resolver> getResolvers(String target);
|
||||||
|
|
||||||
class Holder {
|
class Holder {
|
||||||
static ResolverService service;
|
volatile static ResolverService service;
|
||||||
|
|
||||||
private Holder() {
|
private Holder() {
|
||||||
/* Static variable holder */
|
/* Static variable holder */
|
||||||
|
@ -102,7 +102,7 @@ public interface ResourceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Holder {
|
class Holder {
|
||||||
static ResourceService service;
|
volatile static ResourceService service;
|
||||||
|
|
||||||
private Holder() {
|
private Holder() {
|
||||||
/* Static variable holder */
|
/* Static variable holder */
|
||||||
|
@ -70,7 +70,7 @@ public interface ExtensionService {
|
|||||||
void unregister(DataExtension extension);
|
void unregister(DataExtension extension);
|
||||||
|
|
||||||
class Holder {
|
class Holder {
|
||||||
static ExtensionService service;
|
volatile static ExtensionService service;
|
||||||
|
|
||||||
private Holder() {
|
private Holder() {
|
||||||
/* Static variable holder */
|
/* Static variable holder */
|
||||||
|
@ -149,7 +149,7 @@ public interface QueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Holder {
|
class Holder {
|
||||||
static QueryService service;
|
volatile static QueryService service;
|
||||||
|
|
||||||
private Holder() {
|
private Holder() {
|
||||||
/* Static variable holder */
|
/* Static variable holder */
|
||||||
|
@ -65,7 +65,7 @@ public interface SettingsService {
|
|||||||
List<String> getStringList(String path, Supplier<List<String>> defaultValue);
|
List<String> getStringList(String path, Supplier<List<String>> defaultValue);
|
||||||
|
|
||||||
class Holder {
|
class Holder {
|
||||||
static SettingsService service;
|
volatile static SettingsService service;
|
||||||
|
|
||||||
private Holder() {
|
private Holder() {
|
||||||
/* Static variable holder */
|
/* Static variable holder */
|
||||||
|
Loading…
Reference in New Issue
Block a user