MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / empty

Method empty

tools/python-3.11.9-amd64/Lib/queue.py:97–109  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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!).

Callers

nothing calls this directly

Calls 1

_qsizeMethod · 0.95

Tested by

no test coverage detected