mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +01:00
small change synchronization extensions
This commit is contained in:
parent
6de0761180
commit
58e455142a
@ -88,14 +88,18 @@ public class ExtensionHandler {
|
|||||||
collection.remove(extension);
|
collection.remove(extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
synchronized (extension) {
|
||||||
extension.getExtensionObservable().removeListener(this);
|
extension.getExtensionObservable().removeListener(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
synchronized (extension) {
|
||||||
extension.getExtensionObservable().addListener(respondCallback);
|
extension.getExtensionObservable().addListener(respondCallback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Set<GEarthExtension> collection2;
|
Set<GEarthExtension> collection2;
|
||||||
synchronized (collection) {
|
synchronized (collection) {
|
||||||
@ -104,9 +108,11 @@ public class ExtensionHandler {
|
|||||||
|
|
||||||
synchronized (collection2) {
|
synchronized (collection2) {
|
||||||
for (GEarthExtension extension : collection2) {
|
for (GEarthExtension extension : collection2) {
|
||||||
|
synchronized (extension) {
|
||||||
extension.packetIntercept(new HMessage(message));
|
extension.packetIntercept(new HMessage(message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//block untill all extensions have responded
|
//block untill all extensions have responded
|
||||||
List<GEarthExtension> willdelete = new ArrayList<>();
|
List<GEarthExtension> willdelete = new ArrayList<>();
|
||||||
|
@ -48,7 +48,7 @@ public abstract class GEarthExtension {
|
|||||||
|
|
||||||
// ----------------- listen to the extension ---------------------
|
// ----------------- listen to the extension ---------------------
|
||||||
|
|
||||||
protected final Observable<ExtensionListener> extensionObservable = new Observable<>();
|
protected final Observable<ExtensionListener> extensionObservable = new SynchronizedObservable<>();
|
||||||
public Observable<ExtensionListener> getExtensionObservable() {
|
public Observable<ExtensionListener> getExtensionObservable() {
|
||||||
return extensionObservable;
|
return extensionObservable;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user