mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
bitbake: cooker.py: Lock/Unlock members function into BBCooker
(Bitbake rev: d66dccf9f9a33bfef5c28cc1c767bfc89faee532) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
4b9fc479b6
commit
7bccf59a24
@@ -151,9 +151,7 @@ class BBCooker:
|
|||||||
|
|
||||||
# Take a lock so only one copy of bitbake can run against a given build
|
# Take a lock so only one copy of bitbake can run against a given build
|
||||||
# directory at a time
|
# directory at a time
|
||||||
lockfile = self.data.expand("${TOPDIR}/bitbake.lock")
|
if not self.lockBitbake():
|
||||||
self.lock = bb.utils.lockfile(lockfile, False, False)
|
|
||||||
if not self.lock:
|
|
||||||
bb.fatal("Only one copy of bitbake should be run against a build directory")
|
bb.fatal("Only one copy of bitbake should be run against a build directory")
|
||||||
try:
|
try:
|
||||||
self.lock.seek(0)
|
self.lock.seek(0)
|
||||||
@@ -1547,6 +1545,19 @@ class BBCooker:
|
|||||||
def reset(self):
|
def reset(self):
|
||||||
self.initConfigurationData()
|
self.initConfigurationData()
|
||||||
|
|
||||||
|
def lockBitbake(self):
|
||||||
|
if not hasattr(self, 'lock'):
|
||||||
|
self.lock = None
|
||||||
|
if self.data:
|
||||||
|
lockfile = self.data.expand("${TOPDIR}/bitbake.lock")
|
||||||
|
if lockfile:
|
||||||
|
self.lock = bb.utils.lockfile(lockfile, False, False)
|
||||||
|
return self.lock
|
||||||
|
|
||||||
|
def unlockBitbake(self):
|
||||||
|
if hasattr(self, 'lock') and self.lock:
|
||||||
|
bb.utils.unlockfile(self.lock)
|
||||||
|
|
||||||
def server_main(cooker, func, *args):
|
def server_main(cooker, func, *args):
|
||||||
cooker.pre_serve()
|
cooker.pre_serve()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user