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() or
(self)
| 110 | return self._qsize() |
| 111 | |
| 112 | def empty(self): |
| 113 | '''Return True if the queue is empty, False otherwise (not reliable!). |
| 114 | |
| 115 | This method is likely to be removed at some point. Use qsize() == 0 |
| 116 | as a direct substitute, but be aware that either approach risks a race |
| 117 | condition where a queue can grow before the result of empty() or |
| 118 | qsize() can be used. |
| 119 | |
| 120 | To create code that needs to wait for all queued tasks to be |
| 121 | completed, the preferred technique is to use the join() method. |
| 122 | ''' |
| 123 | with self.mutex: |
| 124 | return not self._qsize() |
| 125 | |
| 126 | def full(self): |
| 127 | '''Return True if the queue is full, False otherwise (not reliable!). |