eclipse-platform / eclipse-platform/eclipse.platform
Expose API to allow querying for Workspace lock
- Lenguaje dominante
- Java
- Estrellas
- 165
- Forks
- 174
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 22
Descripción
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);
}
```
Guía de contribución
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100