Skip to content

Commit

Permalink
Remove synchronized in favor of lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Sep 18, 2023
1 parent 4098017 commit 87f14a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/faforever/client/theme/UiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public ReadOnlyObjectProperty<Theme> currentThemeProperty() {
* Loads an FXML file and returns its controller instance. The controller instance is retrieved from the application
* context, so its scope (which should always be "prototype") depends on the bean definition.
*/
public synchronized <T extends Controller<?>> T loadFxml(String relativePath) {
public <T extends Controller<?>> T loadFxml(String relativePath) {
fxmlLoadLock.lock();
try {
FXMLLoader loader = new FXMLLoader(getThemeFileUrl(relativePath), resources, null, applicationContext::getBean);
Expand All @@ -446,7 +446,7 @@ public synchronized <T extends Controller<?>> T loadFxml(String relativePath) {
}
}

public synchronized <T extends Controller<?>> T loadFxml(String relativePath, Class<?> controllerClass) {
public <T extends Controller<?>> T loadFxml(String relativePath, Class<?> controllerClass) {
fxmlLoadLock.lock();
try {
FXMLLoader loader = new FXMLLoader(getThemeFileUrl(relativePath), resources, null, applicationContext::getBean);
Expand Down

0 comments on commit 87f14a3

Please sign in to comment.