I have a class
Z, all of them are Threads. When
Machine threads are initialized, they are put on a
BlockingQueue firstQueue. Inside machines’ run method there is a while loop which checks if its boolean variable should be true or false. When it is true, machine should be put on
Z class can take it from there. If machine thread returns false, class
X can take machine from
firstQueue and work on it.
Now, my question is: when boolean is true, is it possible to make
Machine take itself from
PS.I know that the question might be unclearly asked, but I don’t know how to form it properly. If anyone knows to make it better, please correct it.