-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
Subscriber类中的take方法被interrupt异常拦截时需要再标记下interrupt,否则线程无法正常结束导致越来越多,最终结果就可能内存溢出
protected byte[] take()
{
byte[] data = null;
try
{
synchronized (lock)
{
while (messages.isEmpty())
{
lock.wait(100);
if (this.isInterrupted()) return null;
}
data = messages.removeFirst();
}
return data;
}
catch(Exception ex)
{
this.interrupt(); //需加入
return null;
}
}
Metadata
Metadata
Assignees
Labels
No labels