MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / Looper

Class Looper

src/main/java/com/volmit/adapt/util/Looper.java:23–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21import com.volmit.adapt.Adapt;
22
23public abstract class Looper extends Thread {
24 public void run() {
25 while (!interrupted()) {
26 try {
27 long m = loop();
28
29 if (m < 0) {
30 break;
31 }
32
33 Thread.sleep(m);
34 } catch (InterruptedException e) {
35 break;
36 } catch (Throwable e) {
37 e.printStackTrace();
38 }
39 }
40
41 Adapt.info("Thread " + getName() + " Shutdown.");
42 }
43
44 protected abstract long loop();
45}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected