We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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; } }
The text was updated successfully, but these errors were encountered:
好的,非常感谢。
Sorry, something went wrong.
No branches or pull requests
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;
}
}
The text was updated successfully, but these errors were encountered: