以下代码片段执行两个线程,一个是简单的计时器每秒记录一次,第二个是执行余数运算的无限循环:publicclassTestBlockingThread{privatestaticfinalLoggerLOGGER=LoggerFactory.getLogger(TestBlockingThread.class);publicstaticfinalvoidmain(String[]args)throwsInterruptedException{Runnabletask=()->{inti=0;while(true){i++;if(i!=0){booleanb=1%i==0;}}};newT
以下代码片段执行两个线程,一个是简单的计时器每秒记录一次,第二个是执行余数运算的无限循环:publicclassTestBlockingThread{privatestaticfinalLoggerLOGGER=LoggerFactory.getLogger(TestBlockingThread.class);publicstaticfinalvoidmain(String[]args)throwsInterruptedException{Runnabletask=()->{inti=0;while(true){i++;if(i!=0){booleanb=1%i==0;}}};newT