public class yourThread extends Thread private static final byte[] lock = new byte[0]; public void run() { ...... synchronized(lock){ //处理块 } ...... }
62,616
社区成员
307,307
社区内容
加载中
试试用AI创作助手写篇文章吧