eclipse-platform / eclipse-platform/eclipse.platform
Expose API to allow querying for Workspace lock
- Langage dominant
- Java
- Étoiles
- 165
- Forks
- 174
- Merge moyen
- 2 j 8 h
- PR mergées (30 j)
- 22
Description
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);
}
```
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- tooling
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100