Skip to content

Commit 54d98ea

Browse files
authored
Fix a potential deadlock on opening a project (#691)
1 parent 1d02ed1 commit 54d98ea

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/src/main/java/edu/wpi/grip/core/sockets/SocketImpl.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ public SocketHint<T> getSocketHint() {
5050
}
5151

5252
@Override
53-
public synchronized void setValueOptional(Optional<? extends T> optionalValue) {
53+
public void setValueOptional(Optional<? extends T> optionalValue) {
5454
checkNotNull(optionalValue, "The optional value can not be null");
5555
if (optionalValue.isPresent()) {
5656
getSocketHint().getType().cast(optionalValue.get());
5757
}
58-
this.value = optionalValue;
59-
onValueChanged();
58+
synchronized (this) {
59+
this.value = optionalValue;
60+
onValueChanged();
61+
}
6062
eventBus.post(new SocketChangedEvent(this));
6163
}
6264

0 commit comments

Comments
 (0)