diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-07 14:38:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-08 13:29:54 +0100 |
commit | 9245c3b87fd56cd157de8f3e8ba1032a3a6be286 (patch) | |
tree | 5bee03cd12d37c4b1e17695e8191f86bc0a35e13 | |
parent | fe40092afb6d27019e6f971a4e33053b080f7c54 (diff) | |
download | poky-9245c3b87fd56cd157de8f3e8ba1032a3a6be286.tar.gz |
bitbake: server/process: Fix waitEvent() calls with 0 timeout
You might think Queue.Queue.get(True, 0) would return an event immediately
if present and otherwise return. It doesn't, it immediately "times out"
and returns with nothing from the queue.
The behaviour we want is not to wait but return anything present which is
what .get(False) does so map to this.
This fixes some odd behaviour observed in some of the tinfoil selftests.
(Bitbake rev: 412bfab8721ea317898a1974f6a7a0d0bea763df)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/server/process.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index c3c1450a50..9ca2b6958d 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -253,6 +253,8 @@ class ProcessEventQueue(multiprocessing.queues.Queue): | |||
253 | try: | 253 | try: |
254 | if not self.server.is_alive(): | 254 | if not self.server.is_alive(): |
255 | return self.getEvent() | 255 | return self.getEvent() |
256 | if timeout == 0: | ||
257 | return self.get(False) | ||
256 | return self.get(True, timeout) | 258 | return self.get(True, timeout) |
257 | except Empty: | 259 | except Empty: |
258 | return None | 260 | return None |