Skip to content

Commit

Permalink
Fix a potential deadlock on opening a project (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCarlberg authored Oct 25, 2016
1 parent 1d02ed1 commit 54d98ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/main/java/edu/wpi/grip/core/sockets/SocketImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ public SocketHint<T> getSocketHint() {
}

@Override
public synchronized void setValueOptional(Optional<? extends T> optionalValue) {
public void setValueOptional(Optional<? extends T> optionalValue) {
checkNotNull(optionalValue, "The optional value can not be null");
if (optionalValue.isPresent()) {
getSocketHint().getType().cast(optionalValue.get());
}
this.value = optionalValue;
onValueChanged();
synchronized (this) {
this.value = optionalValue;
onValueChanged();
}
eventBus.post(new SocketChangedEvent(this));
}

Expand Down

0 comments on commit 54d98ea

Please sign in to comment.