1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.internal
.provisional
.tmf
.ui
.views
.timegraph2
.swtjfx
;
12 import java
.lang
.ref
.WeakReference
;
14 import org
.eclipse
.core
.runtime
.jobs
.Job
;
15 import org
.eclipse
.jdt
.annotation
.Nullable
;
17 public class LatestJobExecutor
{
20 * The latest job that was schedule in this queue.
22 private WeakReference
<@Nullable Job
> fLatestJob
= new WeakReference
<>(null);
24 public LatestJobExecutor() {
27 public synchronized void schedule(Job newJob
) {
28 Job latestJob
= fLatestJob
.get();
29 if (latestJob
!= null) {
31 * Cancel the existing job. Here's hoping it cooperates and ends
37 /* Start the new job */
38 fLatestJob
= new WeakReference
<>(newJob
);
This page took 0.032068 seconds and 5 git commands to generate.