java - What is the purpose of this thread -
what purpose of thisthread created after gui components initialised? first few lines typical boiler plate code when new gui started, i'm struggling understand why thread started. found in open source project, , i'm wondering why this.
public static void main( string args[] ) { java.awt.eventqueue.invokelater( new runnable() { public void run(){ // initialises gui components new schemaregistrationvisualizer(); final thread thisthread = new thread( new runnable(){ public void run(){ long starttime = system.currenttimemillis(); while( system.currenttimemillis() - starttime < math.pow( 10, 5 ) ); system.exit( 0 ); } }); thisthread.setpriority( thread.max_priority ); thisthread.start(); } }); }
well, creates busy loop makes 1 of cpu cores of machine go 100% 100 seconds, , exits jvm.
Comments
Post a Comment