문제

My code:

while( Memo.qRcv.size() > 0) {
    MessageReceived msg=Memo.qRcv.poll();
    ...
}

Then I got

2014-03-01 11:09:36 DEBUG [Thread-16] (threadQueueSendtoUser.java:163) - Memo.qRcv = null, size = 41590
도움이 되었습니까?

해결책

I found solution by using ConcurrentLinkedQueue http://www.javacodex.com/Concurrency/ConcurrentLinkedQueue-Example

Problem here is I used 2 thread to process a Queue, should not use normal queue. I will feedback if any problem

Thank you all

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top