package io.vertx.core.impl;
import io.netty.util.concurrent.FastThreadLocalThread;
import java.util.concurrent.TimeUnit;
public final class VertxThread extends FastThreadLocalThread implements BlockedThreadChecker.Task {
private final boolean worker;
private final long maxExecTime;
private final TimeUnit maxExecTimeUnit;
private long execStart;
private ContextImpl context;
public VertxThread(Runnable target, String name, boolean worker, long maxExecTime, TimeUnit maxExecTimeUnit) {
super(target, name);
this.worker = worker;
this.maxExecTime = maxExecTime;
this.maxExecTimeUnit = maxExecTimeUnit;
}
ContextImpl getContext() {
return context;
}
void setContext(ContextImpl context) {
this.context = context;
}
public final void executeStart() {
execStart = System.nanoTime();
}
public final void executeEnd() {
execStart = 0;
}
public long startTime() {
return execStart;
}
public boolean isWorker() {
return worker;
}
public long maxExecTime() {
return maxExecTime;
}
public TimeUnit maxExecTimeUnit() {
return maxExecTimeUnit;
}
}