Skip to content
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
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