File tree Expand file tree Collapse file tree
src/main/java/the/bytecode/club/bytecodeviewer/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import java .io .InputStream ;
1010import java .io .InputStreamReader ;
1111import java .lang .reflect .Field ;
12- import java .nio .charset .CharsetEncoder ;
13- import java .nio .charset .StandardCharsets ;
1412import java .util .ArrayList ;
1513import java .util .HashSet ;
1614import java .util .List ;
@@ -293,10 +291,26 @@ public static void setLanguage(Language language)
293291 }
294292 }
295293
296- public static Thread startNewThread (String threadName , Runnable threadRunnable )
294+ /**
295+ * START's a new thread (Creates a new thread and runs that thread runnable on it)
296+ */
297+ public static Thread createNewThread (String threadName , Runnable threadRunnable )
298+ {
299+ return createNewThread (threadName , false , threadRunnable );
300+ }
301+
302+ /**
303+ * START's a new thread (Creates a new thread and runs that thread runnable on it)
304+ * RUN's a new thread (Just executes the thread runnable on the active thread)
305+ */
306+ public static Thread createNewThread (String threadName , boolean runDontStart , Runnable threadRunnable )
297307 {
298308 Thread temporaryThread = new Thread (threadRunnable , threadName );
299- temporaryThread .start ();
309+
310+ if (runDontStart )
311+ temporaryThread .run ();
312+ else
313+ temporaryThread .start ();
300314
301315 return temporaryThread ;
302316 }
You can’t perform that action at this time.
0 commit comments