= Queue()
»> x.put(3)
»> x.get()
3
»> x.get() # stuck here forever
Shall I report this bug or does it happen for some some reason that I don't know of? :P
U have put only one element in the array.i.e 3...get() removes the element from the queue...so after the first get() call u don't have any element in the queue....in the second get() call u trying to get an element from the empty queue
That's the point Thread will wait until there's something to do
Обсуждают сегодня