use of org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoader method cancelOngoingRequests.
/**
* Cancels any ongoing find operation
*/
protected void cancelOngoingRequests() {
fLock.lock();
ITmfEventRequest pageRequest = null;
try {
// Cancel the search thread
if (fFindJob != null) {
fFindJob.cancel();
}
fFindResults = null;
fFindCriteria = null;
fCurrentFindIndex = 0;
pageRequest = fPageRequest;
fPageRequest = null;
} finally {
fLock.unlock();
}
if (pageRequest != null && !pageRequest.isCompleted()) {
pageRequest.cancel();
}
}
use of org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoader method dispose.
@Override
public void dispose() {
super.dispose();
ITmfEventRequest indexRequest = null;
fLock.lock();
try {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
// During Eclipse shutdown the active workbench window is null
if (window != null) {
window.getSelectionService().removePostSelectionListener(this);
}
indexRequest = fIndexRequest;
fIndexRequest = null;
cancelOngoingRequests();
fView.setSDFindProvider(null);
fView.setSDPagingProvider(null);
fView.setSDFilterProvider(null);
fView = null;
} finally {
fLock.unlock();
}
if (indexRequest != null && !indexRequest.isCompleted()) {
indexRequest.cancel();
}
}
use of org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest in project tracecompass by tracecompass.
the class TmfEventProvider method fireRequest.
private void fireRequest(boolean isTimeout) {
synchronized (fLock) {
if (fRequestPendingCounter > 0) {
return;
}
if (!fPendingCoalescedRequests.isEmpty()) {
Iterator<TmfCoalescedEventRequest> iter = fPendingCoalescedRequests.iterator();
while (iter.hasNext()) {
ExecutionType type = (isTimeout ? ExecutionType.BACKGROUND : ExecutionType.FOREGROUND);
ITmfEventRequest request = iter.next();
if (type == request.getExecType()) {
queueRequest(request);
iter.remove();
}
}
}
}
}
Aggregations