Use SleepUtil API
This commit is contained in:
parent
938ee3f51b
commit
406b47bf8c
|
@ -22,6 +22,7 @@ import org.objectweb.asm.ClassReader;
|
|||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
import the.bytecode.club.bytecodeviewer.util.SleepUtil;
|
||||
|
||||
/**
|
||||
* @author Konloch
|
||||
|
@ -61,14 +62,10 @@ public class ASMUtil
|
|||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
try
|
||||
{
|
||||
Thread.sleep(200);
|
||||
cn.accept(cw);
|
||||
}
|
||||
catch (InterruptedException ignored)
|
||||
{
|
||||
}
|
||||
|
||||
SleepUtil.sleep(200);
|
||||
|
||||
cn.accept(cw);
|
||||
}
|
||||
|
||||
return cw.toByteArray();
|
||||
|
|
|
@ -223,14 +223,10 @@ public class BCV
|
|||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
try
|
||||
{
|
||||
Thread.sleep(200);
|
||||
Objects.requireNonNull(cn).accept(cw);
|
||||
}
|
||||
catch (InterruptedException ignored)
|
||||
{
|
||||
}
|
||||
|
||||
SleepUtil.sleep(200);
|
||||
|
||||
Objects.requireNonNull(cn).accept(cw);
|
||||
}
|
||||
|
||||
return cw.toByteArray();
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui.components;
|
||||
|
||||
import the.bytecode.club.bytecodeviewer.Constants;
|
||||
import the.bytecode.club.bytecodeviewer.util.SleepUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.PrintStream;
|
||||
|
@ -68,13 +69,7 @@ public class JFrameConsolePrintStream extends JFrameConsole
|
|||
{
|
||||
update();
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(10);
|
||||
}
|
||||
catch (InterruptedException ignored)
|
||||
{
|
||||
}
|
||||
SleepUtil.sleep(10);
|
||||
}
|
||||
|
||||
lastUpdate = 0;
|
||||
|
|
|
@ -28,6 +28,7 @@ import the.bytecode.club.bytecodeviewer.gui.resourceviewer.BytecodeViewPanel;
|
|||
import the.bytecode.club.bytecodeviewer.resources.Resource;
|
||||
import the.bytecode.club.bytecodeviewer.resources.ResourceContainer;
|
||||
import the.bytecode.club.bytecodeviewer.util.MethodParser;
|
||||
import the.bytecode.club.bytecodeviewer.util.SleepUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.BadLocationException;
|
||||
|
@ -102,17 +103,10 @@ public class ClassViewer extends ResourceViewer
|
|||
{
|
||||
BytecodeViewer.updateBusyStatus(true);
|
||||
|
||||
//wait until it's not dumping
|
||||
while (Configuration.currentlyDumping)
|
||||
{
|
||||
//wait until it's not dumping
|
||||
try
|
||||
{
|
||||
Thread.sleep(100);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
SleepUtil.sleep(100);
|
||||
}
|
||||
|
||||
BytecodeViewer.updateBusyStatus(false);
|
||||
|
|
|
@ -37,6 +37,7 @@ import the.bytecode.club.bytecodeviewer.resources.classcontainer.ClassFileContai
|
|||
import the.bytecode.club.bytecodeviewer.resources.classcontainer.locations.*;
|
||||
import the.bytecode.club.bytecodeviewer.resources.classcontainer.parser.TokenUtil;
|
||||
import the.bytecode.club.bytecodeviewer.util.MethodParser;
|
||||
import the.bytecode.club.bytecodeviewer.util.SleepUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.CaretEvent;
|
||||
|
@ -133,13 +134,7 @@ public class BytecodeViewPanelUpdater implements Runnable
|
|||
//hold this thread until the swing thread has finished attaching the components
|
||||
while (waitingFor)
|
||||
{
|
||||
try
|
||||
{
|
||||
Thread.sleep(1);
|
||||
}
|
||||
catch (Exception ignored)
|
||||
{
|
||||
}
|
||||
SleepUtil.sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,20 +82,14 @@ public class Enjarify
|
|||
if (output.length() > 0)
|
||||
holdThread.set(false);
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(500);
|
||||
}
|
||||
catch (InterruptedException ignored)
|
||||
{
|
||||
}
|
||||
SleepUtil.sleep(500);
|
||||
}
|
||||
}, "Enjarify Fail Safe Thread").start();
|
||||
|
||||
//hold thread while enjarify is processing
|
||||
while (holdThread.get())
|
||||
{
|
||||
Thread.sleep(100);
|
||||
SleepUtil.sleep(100);
|
||||
}
|
||||
|
||||
//kill the python3 process if it's still alive
|
||||
|
|
Loading…
Reference in New Issue
Block a user