thread_pool: support passing thread IDs

Then use that to fix gem5 error log read race.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent b49ebb1c8a
commit 5daad53289
5 changed files with 52 additions and 16 deletions

View File

@@ -175,6 +175,7 @@ class ShellHelpers:
if not self.quiet:
self._print_thread_safe('+ ' + cmd_string)
if cmd_file is not None:
os.makedirs(os.path.dirname(cmd_file), exist_ok=True)
with open(cmd_file, 'w') as f:
f.write('#!/usr/bin/env bash\n')
f.write(cmd_string)