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

Fix build block user action (#472) #1743

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/bundles/org.eclipse.core.jobs/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.core.jobs; singleton:=true
Bundle-Version: 3.15.500.qualifier
Bundle-Version: 3.16.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.core.internal.jobs;x-internal:=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ public boolean aboutToWait(Thread lockOwner) {
return false;
}

public boolean isUI() {
try {
return lockListener.isUI();
} catch (Exception | LinkageError e) {
handleException(e);
}
return false;
}

/**
* This thread has just acquired a lock. Update graph.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static ThreadJob joinRun(ThreadJob threadJob, IProgressMonitor monitor) {
boolean interruptedDuringWaitForRun;
try {
// just return if lock listener decided to grant immediate access
if (manager.getLockManager().aboutToWait(blocker)) {
if (manager.getLockManager().aboutToWait(blocker) || manager.getLockManager().isUI()) {
return threadJob;
}
result = waitForRun(threadJob, monitor, blockingJob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public boolean aboutToWait(Thread lockOwner) {
return false;
}

/**
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to document this new API method and explain in details when/why should one say it's UI . Even if it looks "obvious" - having things written explicitly helps in reducing difference in expectations.

* @since 3.16
*/
public boolean isUI() {
return false;
}
/**
* Notification that a thread is about to release a lock.
* <p>
Expand Down
Loading