62,614
社区成员
发帖
与我相关
我的任务
分享
if (m_out_q.size() > = m_maxsize)
return;
if (m_out_q.size() > = m_maxsize){
m_out_q.notify();
return;
}
public void run() {
byte[] thismsg = null;
while (true) {
synchronized (m_out_q) {
while (m_out_q.isEmpty()) {
try {
m_out_q.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
thismsg = m_out_q.removeFirst(); // 对m_out_q同步
}
} // end of synchronized
UDPService.sendMessage(thismsg);
}
}