In this question, the poster asks what I think is a genuine question with some explanation and a short snippet triggering a bunch of answers. Then, OP erased his snippet and replaced it with a good old text straight from an exercise.
What should be do when OP replaced his MCVE with the text of his homework question?
Note: I voted to close it but I think about retracting my vote.
MyQueue
class? Or why is Sleep commented out? The point is, we are just guessing what op needs, expect for a complete solution to his task.