OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 177 Rev 180
Line 31... Line 31...
31
import java.util.concurrent.ScheduledFuture;
31
import java.util.concurrent.ScheduledFuture;
32
import java.util.concurrent.ScheduledThreadPoolExecutor;
32
import java.util.concurrent.ScheduledThreadPoolExecutor;
33
import java.util.concurrent.TimeUnit;
33
import java.util.concurrent.TimeUnit;
34
import java.util.concurrent.atomic.AtomicBoolean;
34
import java.util.concurrent.atomic.AtomicBoolean;
35
import java.util.concurrent.atomic.AtomicReference;
35
import java.util.concurrent.atomic.AtomicReference;
-
 
36
import java.util.function.Function;
36
import java.util.logging.Level;
37
import java.util.logging.Level;
37
 
38
 
38
import net.jcip.annotations.GuardedBy;
39
import net.jcip.annotations.GuardedBy;
39
 
40
 
40
/**
41
/**
Line 416... Line 417...
416
 
417
 
417
    public final void tasksDo(IClosure<? super Deque<RunnableFuture<?>>> c) {
418
    public final void tasksDo(IClosure<? super Deque<RunnableFuture<?>>> c) {
418
        this.tasksQueue.itemsDo(c);
419
        this.tasksQueue.itemsDo(c);
419
    }
420
    }
420
 
421
 
-
 
422
    public final <R> R tasksDo(Function<? super Deque<RunnableFuture<?>>, R> c) {
-
 
423
        return this.tasksQueue.itemsDo(c);
-
 
424
    }
-
 
425
 
421
    private void cancelCheck(RunnableFuture<?> t) {
426
    private void cancelCheck(RunnableFuture<?> t) {
422
        if (t != null)
427
        if (t != null)
423
            synchronized (this) {
428
            synchronized (this) {
424
                if (this.canceling && (this.cancelPredicate == null || this.cancelPredicate.evaluateChecked(t)))
429
                if (this.canceling && (this.cancelPredicate == null || this.cancelPredicate.evaluateChecked(t)))
425
                    t.cancel(true);
430
                    t.cancel(true);