Return True if the queue is empty, False otherwise (not reliable!). This method is likely to be removed at some point. Use qsize() == 0 as a direct substitute, but be aware that either approach risks a race condition where a queue can grow before the result of empty() o
(self)
| 95 | return self._qsize() |
| 96 | |
| 97 | def empty(self): |
| 98 | '''Return True if the queue is empty, False otherwise (not reliable!). |
| 99 | |
| 100 | This method is likely to be removed at some point. Use qsize() == 0 |
| 101 | as a direct substitute, but be aware that either approach risks a race |
| 102 | condition where a queue can grow before the result of empty() or |
| 103 | qsize() can be used. |
| 104 | |
| 105 | To create code that needs to wait for all queued tasks to be |
| 106 | completed, the preferred technique is to use the join() method. |
| 107 | ''' |
| 108 | with self.mutex: |
| 109 | return not self._qsize() |
| 110 | |
| 111 | def full(self): |
| 112 | '''Return True if the queue is full, False otherwise (not reliable!). |