diff --git a/tools/toolchains/mbed_toolchain.py b/tools/toolchains/mbed_toolchain.py index 60e238d7c11..e216c579795 100755 --- a/tools/toolchains/mbed_toolchain.py +++ b/tools/toolchains/mbed_toolchain.py @@ -556,9 +556,7 @@ def compile_queue(self, queue, objects): ]) objects.append(result['object']) except ToolException as err: - if p._taskqueue.queue: - p._taskqueue.queue.clear() - sleep(0.5) + # Stop the worker processes immediately without completing outstanding work p.terminate() p.join() raise ToolException(err)