summaryrefslogtreecommitdiff
path: root/src/buildstream/_context.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-08-07 13:21:04 +0200
committerJürg Billeter <j@bitron.ch>2019-08-20 08:09:52 +0200
commit1519ad94ddfa3732d215356fbc54c2643cc1bf1f (patch)
treefa5f96eaf67711cd2d011b20a5e00aff5690fbe4 /src/buildstream/_context.py
parente54883ba1fa6a0f4466f2781c148a7744b075a0b (diff)
downloadbuildstream-1519ad94ddfa3732d215356fbc54c2643cc1bf1f.tar.gz
_context.py: Add disable_fork() method
Calling disable_fork() will prevent the scheduler from running but will allow communication with casd in the main process.
Diffstat (limited to 'src/buildstream/_context.py')
-rw-r--r--src/buildstream/_context.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index 5aa1f595f..211ee1cae 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -150,6 +150,8 @@ class Context():
# Whether file contents are required for all artifacts in the local cache
self.require_artifact_files = True
+ self.fork_allowed = True
+
# Whether elements must be rebuilt when their dependencies have changed
self._strict_build_plan = None
@@ -487,3 +489,13 @@ class Context():
if self._cascache is None:
self._cascache = CASCache(self.cachedir)
return self._cascache
+
+ # disable_fork():
+ #
+ # This will prevent the scheduler from running but will allow communication
+ # with casd in the main process.
+ #
+ def disable_fork(self):
+ self.fork_allowed = False
+ cascache = self.get_cascache()
+ cascache.notify_fork_disabled()