mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 12:07:35 +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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
@ -64,6 +64,6 @@ public interface CapabilityService {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
class Holder {
|
||||
static ResolverService service;
|
||||
volatile static ResolverService service;
|
||||
|
||||
private Holder() {
|
||||
/* Static variable holder */
|
||||
|
@ -102,7 +102,7 @@ public interface ResourceService {
|
||||
}
|
||||
|
||||
class Holder {
|
||||
static ResourceService service;
|
||||
volatile static ResourceService service;
|
||||
|
||||
private Holder() {
|
||||
/* Static variable holder */
|
||||
|
@ -70,7 +70,7 @@ public interface ExtensionService {
|
||||
void unregister(DataExtension extension);
|
||||
|
||||
class Holder {
|
||||
static ExtensionService service;
|
||||
volatile static ExtensionService service;
|
||||
|
||||
private Holder() {
|
||||
/* Static variable holder */
|
||||
|
@ -149,7 +149,7 @@ public interface QueryService {
|
||||
}
|
||||
|
||||
class Holder {
|
||||
static QueryService service;
|
||||
volatile static QueryService service;
|
||||
|
||||
private Holder() {
|
||||
/* Static variable holder */
|
||||
|
@ -65,7 +65,7 @@ public interface SettingsService {
|
||||
List<String> getStringList(String path, Supplier<List<String>> defaultValue);
|
||||
|
||||
class Holder {
|
||||
static SettingsService service;
|
||||
volatile static SettingsService service;
|
||||
|
||||
private Holder() {
|
||||
/* Static variable holder */
|
||||
|
Loading…
Reference in New Issue
Block a user