packagecom.ysf.day0427;publicclassTst03ShareVar{staticvolatileboolean flag =true;publicstaticvoidmain(String[] args)throwsInterruptedException{Thread t =newThread(()->{while(flag){//处理业务}System.out.println("任务结束");},"share-1");
t.start();Thread.sleep(1000L);
flag =false;}}
3.使用interrupt
3.1 interrupt标记位
线程中存在一个标记位interrupt,来标识线程是否被打断
该标记位默认情况下是false
3.2 查询线程标记位
对象方法:isInterrupted()
packagecom.ysf.day0427;publicclassTst04QueryInterrupt{publicstaticvoidmain(String[] args)throwsInterruptedException{Thread t1 =newThread(()->{for(int i =0;i<5;i++){System.out.println(i);try{Thread.sleep(500L);}catch(InterruptedException e){
e.printStackTrace();}}},"interrupt-1");
t1.start();Thread.sleep(1000L);System.out.println(t1.isInterrupted());}}
问题1.初始构造heima-leadnews-user这个模块 触发此bug
Command line is too long 解决办法:
问题2:构建网关模块启动时 报数据库错误
Failed to configure a DataSource: url attribute is not specified and no embedded datasource could be confi…
好久没在官网下载 mysql server 安装包。今天想下载发现:
我访问mysql官网的速度好慢啊。mysql server 的下载页面在哪里啊,一下两下找不到。
最后,慢慢悠悠终于找到了下载页面,如下:
https://dev.mysql.com/downlo…