what-the-bank/sources/okhttp3/repackaged/internal/NamedRunnable.java

24 lines
612 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package okhttp3.repackaged.internal;
/* loaded from: classes6.dex */
public abstract class NamedRunnable implements Runnable {
protected final String name;
protected abstract void execute();
public NamedRunnable(String str, Object... objArr) {
this.name = String.format(str, objArr);
}
@Override // java.lang.Runnable
public final void run() {
String name = Thread.currentThread().getName();
Thread.currentThread().setName(this.name);
try {
execute();
} finally {
Thread.currentThread().setName(name);
}
}
}