Java - LinkedBlockingQueue problem
-
07-11-2019 - |
문제
1 LinkedBlockingQueue queJobs = new LinkedBlockingQueue(150); 2 .......... 3 .. Some other code.... 4 .......... 5 Job curJob = queJobs.take(); 6 .................... 7 .. Again some other code... 8 .................... 9 if(condition1){ 10 queJobs.put(curJob); 11 }
my problem is when condition1 is true, I am putting back the object into queue. but initially it was on top of the queue, but after putting, it will go at the end of queue.
My requirement is :
1. I can put back the element on top of the queue
or
2. Somehow I can wait at line 5, without removing element from the queue.
올바른 솔루션이 없습니다
제휴하지 않습니다 StackOverflow