private boolean isWorkspaceLockedByCurrentThread() { try { WorkManager workManager = ((Workspace) workspace).getWorkManager(); return workManager.isLockAlreadyAcquired(); } catch (CoreException e) { return false; } }