diff options
Diffstat (limited to 'bitbake/lib/bb/server')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index ac7749d36c..b5f6faf6fb 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -113,7 +113,7 @@ class ProcessServer(): | |||
113 | def register_idle_function(self, function, data): | 113 | def register_idle_function(self, function, data): |
114 | """Register a function to be called while the server is idle""" | 114 | """Register a function to be called while the server is idle""" |
115 | assert hasattr(function, '__call__') | 115 | assert hasattr(function, '__call__') |
116 | with self._idlefuncsLock: | 116 | with bb.utils.lock_timeout(self._idlefuncsLock): |
117 | self._idlefuns[function] = data | 117 | self._idlefuns[function] = data |
118 | serverlog("Registering idle function %s" % str(function)) | 118 | serverlog("Registering idle function %s" % str(function)) |
119 | 119 | ||
@@ -379,7 +379,7 @@ class ProcessServer(): | |||
379 | 379 | ||
380 | def idle_thread(self): | 380 | def idle_thread(self): |
381 | def remove_idle_func(function): | 381 | def remove_idle_func(function): |
382 | with self._idlefuncsLock: | 382 | with bb.utils.lock_timeout(self._idlefuncsLock): |
383 | del self._idlefuns[function] | 383 | del self._idlefuns[function] |
384 | self.idle_cond.notify_all() | 384 | self.idle_cond.notify_all() |
385 | 385 | ||
@@ -387,7 +387,7 @@ class ProcessServer(): | |||
387 | nextsleep = 0.1 | 387 | nextsleep = 0.1 |
388 | fds = [] | 388 | fds = [] |
389 | 389 | ||
390 | with self._idlefuncsLock: | 390 | with bb.utils.lock_timeout(self._idlefuncsLock): |
391 | items = list(self._idlefuns.items()) | 391 | items = list(self._idlefuns.items()) |
392 | 392 | ||
393 | for function, data in items: | 393 | for function, data in items: |
@@ -743,7 +743,7 @@ class BBUIEventQueue: | |||
743 | self.t.start() | 743 | self.t.start() |
744 | 744 | ||
745 | def getEvent(self): | 745 | def getEvent(self): |
746 | with self.eventQueueLock: | 746 | with bb.utils.lock_timeout(self.eventQueueLock): |
747 | if len(self.eventQueue) == 0: | 747 | if len(self.eventQueue) == 0: |
748 | return None | 748 | return None |
749 | 749 | ||
@@ -758,7 +758,7 @@ class BBUIEventQueue: | |||
758 | return self.getEvent() | 758 | return self.getEvent() |
759 | 759 | ||
760 | def queue_event(self, event): | 760 | def queue_event(self, event): |
761 | with self.eventQueueLock: | 761 | with bb.utils.lock_timeout(self.eventQueueLock): |
762 | self.eventQueue.append(event) | 762 | self.eventQueue.append(event) |
763 | self.eventQueueNotify.set() | 763 | self.eventQueueNotify.set() |
764 | 764 | ||
@@ -794,7 +794,7 @@ class ConnectionReader(object): | |||
794 | return self.reader.poll(timeout) | 794 | return self.reader.poll(timeout) |
795 | 795 | ||
796 | def get(self): | 796 | def get(self): |
797 | with self.rlock: | 797 | with bb.utils.lock_timeout(self.rlock): |
798 | res = self.reader.recv_bytes() | 798 | res = self.reader.recv_bytes() |
799 | return multiprocessing.reduction.ForkingPickler.loads(res) | 799 | return multiprocessing.reduction.ForkingPickler.loads(res) |
800 | 800 | ||
@@ -815,7 +815,7 @@ class ConnectionWriter(object): | |||
815 | 815 | ||
816 | def _send(self, obj): | 816 | def _send(self, obj): |
817 | gc.disable() | 817 | gc.disable() |
818 | with self.wlock: | 818 | with bb.utils.lock_timeout(self.wlock): |
819 | self.writer.send_bytes(obj) | 819 | self.writer.send_bytes(obj) |
820 | gc.enable() | 820 | gc.enable() |
821 | 821 | ||
@@ -828,7 +828,7 @@ class ConnectionWriter(object): | |||
828 | # pthread_sigmask block/unblock would be nice but doesn't work, https://bugs.python.org/issue47139 | 828 | # pthread_sigmask block/unblock would be nice but doesn't work, https://bugs.python.org/issue47139 |
829 | process = multiprocessing.current_process() | 829 | process = multiprocessing.current_process() |
830 | if process and hasattr(process, "queue_signals"): | 830 | if process and hasattr(process, "queue_signals"): |
831 | with process.signal_threadlock: | 831 | with bb.utils.lock_timeout(process.signal_threadlock): |
832 | process.queue_signals = True | 832 | process.queue_signals = True |
833 | self._send(obj) | 833 | self._send(obj) |
834 | process.queue_signals = False | 834 | process.queue_signals = False |