| author | William R. Swanson | 2011-12-12 05:47:25 (EST) |
|---|---|---|
| committer | Marc Khouzam | 2011-12-12 11:28:13 (EST) |
| commit | 1291c9844716ada5ac164fbb0527153ec0098530 (patch) (side-by-side diff) | |
| tree | f4d02c297a8f3ab96193b17b7e64e964d59e09ac | |
| parent | cb5ea6b704e23636df92ff4fcf190ae70c9b6626 (diff) | |
| download | org.eclipse.cdt-1291c9844716ada5ac164fbb0527153ec0098530.zip org.eclipse.cdt-1291c9844716ada5ac164fbb0527153ec0098530.tar.gz org.eclipse.cdt-1291c9844716ada5ac164fbb0527153ec0098530.tar.bz2 | |
Bug 365966: Convenience RequestMonitor classes using ImmediateExecutor
3 files changed, 102 insertions, 0 deletions
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateCountingRequestMonitor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateCountingRequestMonitor.java new file mode 100644 index 0000000..8d62b46 --- a/dev/null +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateCountingRequestMonitor.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2011 Tilera Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William R. Swanson (Tilera) - initial API and implementation (Bug 365966) + *******************************************************************************/ + +package org.eclipse.cdt.dsf.concurrent; + +/** + * Convenience extension of CountingRequestMonitor that uses the ImmediateExecutor. + * The handleCompleted() method is immediately executed in same thread as done() call. + * @since 2.3 + */ +public class ImmediateCountingRequestMonitor extends CountingRequestMonitor +{ + /** + * Constructor without a parent monitor and using ImmediateExecutor. + */ + public ImmediateCountingRequestMonitor() { + super(ImmediateExecutor.getInstance(), null); + } + + /** + * Constructor with an optional parent monitor and using ImmediateExecutor. + */ + public ImmediateCountingRequestMonitor(RequestMonitor parentMonitor) { + super(ImmediateExecutor.getInstance(), parentMonitor); + } +} diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateDataRequestMonitor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateDataRequestMonitor.java new file mode 100644 index 0000000..4c28b65 --- a/dev/null +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateDataRequestMonitor.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2011 Tilera Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William R. Swanson (Tilera) - initial API and implementation (Bug 365966) + *******************************************************************************/ + +package org.eclipse.cdt.dsf.concurrent; + +/** + * Convenience extension of DataRequestMonitor that uses the ImmediateExecutor. + * The handleCompleted() method is immediately executed in same thread as done() call. + * @since 2.3 + */ +public class ImmediateDataRequestMonitor<V> extends DataRequestMonitor<V> +{ + /** + * Constructor without a parent monitor and using ImmediateExecutor. + */ + public ImmediateDataRequestMonitor() { + super(ImmediateExecutor.getInstance(), null); + } + + /** + * Constructor with an optional parent monitor and using ImmediateExecutor. + */ + public ImmediateDataRequestMonitor(RequestMonitor parentMonitor) { + super(ImmediateExecutor.getInstance(), parentMonitor); + } +} diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateRequestMonitor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateRequestMonitor.java new file mode 100644 index 0000000..22370e0 --- a/dev/null +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateRequestMonitor.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2011 Tilera Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William R. Swanson (Tilera) - initial API and implementation (Bug 365966) + *******************************************************************************/ + +package org.eclipse.cdt.dsf.concurrent; + +/** + * Convenience extension of RequestMonitor that uses the ImmediateExecutor. + * The handleCompleted() method is immediately executed in same thread as done() call. + * @since 2.3 + */ +public class ImmediateRequestMonitor extends RequestMonitor +{ + /** + * Constructor without a parent monitor and using ImmediateExecutor. + */ + public ImmediateRequestMonitor() { + super(ImmediateExecutor.getInstance(), null); + } + + /** + * Constructor with an optional parent monitor and using ImmediateExecutor. + */ + public ImmediateRequestMonitor(RequestMonitor parentMonitor) { + super(ImmediateExecutor.getInstance(), parentMonitor); + } +}
\ No newline at end of file |

