diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-09 23:17:56 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-11 10:58:36 +0000 |
commit | 165e8b563d400bf54c317659a267db85e8c34006 (patch) | |
tree | 7e4d05e7d3440b6f95c029afabf1822d3f7b2733 /bitbake/lib/bb/cooker.py | |
parent | 4e4f040a73ca81f830cf90af05b75e7c06f91d8d (diff) | |
download | poky-165e8b563d400bf54c317659a267db85e8c34006.tar.gz |
bitbake: process/cooker/command: Fix currentAsyncCommand locking/races
currentAsyncCommand currently doesn't have any locking and we have
a conflict in "idle" conditions since the idle functions count needs
to be zero *and* there needs to be no active command.
Move the changes/checks of currentAsyncCommand to within the lock
and then we can add it to the condition for idle, simplifying some
of the code.
(Bitbake rev: b5215887d2f8ea3f28f1ebda721bd5b8f93ec7f3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 13d6e9d847..5a0e675b44 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -149,7 +149,7 @@ class BBCooker: | |||
149 | Manages one bitbake build run | 149 | Manages one bitbake build run |
150 | """ | 150 | """ |
151 | 151 | ||
152 | def __init__(self, featureSet=None, idleCallBackRegister=None, waitIdle=None): | 152 | def __init__(self, featureSet=None, server=None): |
153 | self.recipecaches = None | 153 | self.recipecaches = None |
154 | self.eventlog = None | 154 | self.eventlog = None |
155 | self.skiplist = {} | 155 | self.skiplist = {} |
@@ -163,8 +163,12 @@ class BBCooker: | |||
163 | 163 | ||
164 | self.configuration = bb.cookerdata.CookerConfiguration() | 164 | self.configuration = bb.cookerdata.CookerConfiguration() |
165 | 165 | ||
166 | self.idleCallBackRegister = idleCallBackRegister | 166 | self.process_server = server |
167 | self.waitIdle = waitIdle | 167 | self.idleCallBackRegister = None |
168 | self.waitIdle = None | ||
169 | if server: | ||
170 | self.idleCallBackRegister = server.register_idle_function | ||
171 | self.waitIdle = server.wait_for_idle | ||
168 | 172 | ||
169 | bb.debug(1, "BBCooker starting %s" % time.time()) | 173 | bb.debug(1, "BBCooker starting %s" % time.time()) |
170 | sys.stdout.flush() | 174 | sys.stdout.flush() |
@@ -203,7 +207,7 @@ class BBCooker: | |||
203 | except UnsupportedOperation: | 207 | except UnsupportedOperation: |
204 | pass | 208 | pass |
205 | 209 | ||
206 | self.command = bb.command.Command(self) | 210 | self.command = bb.command.Command(self, self.process_server) |
207 | self.state = state.initial | 211 | self.state = state.initial |
208 | 212 | ||
209 | self.parser = None | 213 | self.parser = None |