diff options
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index e2cec49b74..c0af052ebd 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -29,6 +29,7 @@ import os | |||
29 | import signal | 29 | import signal |
30 | import sys | 30 | import sys |
31 | import time | 31 | import time |
32 | import select | ||
32 | from Queue import Empty | 33 | from Queue import Empty |
33 | from multiprocessing import Event, Process, util, Queue, Pipe, queues | 34 | from multiprocessing import Event, Process, util, Queue, Pipe, queues |
34 | 35 | ||
@@ -105,7 +106,7 @@ class ProcessServer(Process, BaseImplServer): | |||
105 | command = self.command_channel.recv() | 106 | command = self.command_channel.recv() |
106 | self.runCommand(command) | 107 | self.runCommand(command) |
107 | 108 | ||
108 | self.idle_commands(.1) | 109 | self.idle_commands(.1, [self.event_queue._reader, self.command_channel]) |
109 | except Exception: | 110 | except Exception: |
110 | logger.exception('Running command %s', command) | 111 | logger.exception('Running command %s', command) |
111 | 112 | ||
@@ -115,7 +116,7 @@ class ProcessServer(Process, BaseImplServer): | |||
115 | self.cooker.stop() | 116 | self.cooker.stop() |
116 | self.idle_commands(.1) | 117 | self.idle_commands(.1) |
117 | 118 | ||
118 | def idle_commands(self, delay): | 119 | def idle_commands(self, delay, fds = []): |
119 | nextsleep = delay | 120 | nextsleep = delay |
120 | 121 | ||
121 | for function, data in self._idlefuns.items(): | 122 | for function, data in self._idlefuns.items(): |
@@ -127,15 +128,15 @@ class ProcessServer(Process, BaseImplServer): | |||
127 | nextsleep = None | 128 | nextsleep = None |
128 | elif nextsleep is None: | 129 | elif nextsleep is None: |
129 | continue | 130 | continue |
130 | elif retval < nextsleep: | 131 | else: |
131 | nextsleep = retval | 132 | fds = fds + retval |
132 | except SystemExit: | 133 | except SystemExit: |
133 | raise | 134 | raise |
134 | except Exception: | 135 | except Exception: |
135 | logger.exception('Running idle function') | 136 | logger.exception('Running idle function') |
136 | 137 | ||
137 | if nextsleep is not None: | 138 | if nextsleep is not None: |
138 | time.sleep(nextsleep) | 139 | select.select(fds,[],[],nextsleep) |
139 | 140 | ||
140 | def runCommand(self, command): | 141 | def runCommand(self, command): |
141 | """ | 142 | """ |