mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 20:45:22 +02:00
Throw RemoteFileCanceledException in case IFileService operations were canceled
This commit is contained in:
parent
027ca1461a
commit
a34964063b
2 changed files with 12 additions and 1 deletions
|
@ -336,6 +336,8 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
||||||
} finally {
|
} finally {
|
||||||
fDirChannelMutex.release();
|
fDirChannelMutex.release();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw new RemoteFileCancelledException();
|
||||||
}
|
}
|
||||||
return (IHostFile[])results.toArray(new IHostFile[results.size()]);
|
return (IHostFile[])results.toArray(new IHostFile[results.size()]);
|
||||||
}
|
}
|
||||||
|
@ -607,6 +609,8 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
||||||
} finally {
|
} finally {
|
||||||
fDirChannelMutex.release();
|
fDirChannelMutex.release();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw new RemoteFileCancelledException();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -627,6 +631,8 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
||||||
} finally {
|
} finally {
|
||||||
fDirChannelMutex.release();
|
fDirChannelMutex.release();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw new RemoteFileCancelledException();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -945,7 +951,9 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
||||||
Activator.trace("SftpFileService.getOutputStream " + remoteFile + " failed: " + e.toString()); //$NON-NLS-1$ //$NON-NLS-2$
|
Activator.trace("SftpFileService.getOutputStream " + remoteFile + " failed: " + e.toString()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
throw makeSystemMessageException(e);
|
throw makeSystemMessageException(e);
|
||||||
}
|
}
|
||||||
|
if (monitor.isCanceled()) {
|
||||||
|
throw new RemoteFileCancelledException();
|
||||||
|
}
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -69,6 +69,9 @@ public class Mutex {
|
||||||
if (Thread.interrupted()) {
|
if (Thread.interrupted()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (monitor!=null && monitor.isCanceled()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
final Thread myself = Thread.currentThread();
|
final Thread myself = Thread.currentThread();
|
||||||
synchronized(fWaitQueue) {
|
synchronized(fWaitQueue) {
|
||||||
if (!fLocked) {
|
if (!fLocked) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue