Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BatchModeTest: show UI on EDT #308

Closed
wants to merge 1 commit into from
Closed

BatchModeTest: show UI on EDT #308

wants to merge 1 commit into from

Conversation

hinerm
Copy link
Member

@hinerm hinerm commented Jul 19, 2024

Closes #306

@hinerm hinerm requested a review from ctrueden July 19, 2024 19:29
@hinerm
Copy link
Member Author

hinerm commented Jul 19, 2024

So the problem is that in the test we call service.showUI on the main thread, which of course then deadlocks with the EDT since we're using graphical components off the EDT.

But I'm not sure that we don't want to make this dispatch to the EDT elsewhere in the UIService stack..?
image

Copy link
Member

@ctrueden ctrueden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to fix this in scijava-ui-swing instead?

@ctrueden
Copy link
Member

Hmm... it turns out the UserInterface interface has a requiresEDT boolean flag, which is present all the way into SciJava Common. That's maybe a violation of separation of concerns, but it's already there, so we can use it: the base showUI implementation, independent of any user interface, could use threadService.invoke(() -> ui.show()) or whatever if that flag returns true?

Otherwise this can lead to deadlocks.

See #306
@hinerm
Copy link
Member Author

hinerm commented Jul 22, 2024

Closing in favor of scijava/scijava-common#481

@hinerm hinerm closed this Jul 22, 2024
@hinerm hinerm deleted the batch-mode-test branch July 22, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building hangs on Linux (WSL Ubuntu 24)
2 participants