eclipse-platform / eclipse-platform/eclipse.platform

Expose API to allow querying for Workspace lock

Offen
#360 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
165
Forks
174
Ø Merge
2 T. 8 Std.
Gemergte PRs (30 T.)
22

Beschreibung

I believe there is value in having an API to check whether the current thread owns the workspace lock. This would allow implementing something like deadlock prevention as a safeguard.

Right now it is possible using internals:
```
var workspace = ResourcesPlugin.getWorkspace();
try {
if (((Workspace) workspace).getWorkManager().isLockAlreadyAcquired()) {
throw new IllegalStateException(format(
"The current thread (%s) already owns the workspace lock. Calling get() will almost certainly cause a deadlock!",
Thread.currentThread()));
}
} catch (CoreException e) {
throw new IllegalStateException("The workspace is shutdown!", e);
}
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with ResourcesPlugin.getWorkspace() and the internal Workspace.getWorkManager().isLockAlreadyAcquired() path shown in the issue. Review the workspace locking API boundary and determine how ownership can be exposed publicly; done means clients can check whether the current thread owns the workspace lock without casting to internals.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.