Print with a lock to prevent garbled output for multiple threads.
(string: str)
| 5 | |
| 6 | |
| 7 | def locked_print(string: str): |
| 8 | """Print with a lock to prevent garbled output for multiple threads.""" |
| 9 | with PRINT_LOCK: |
| 10 | # print only prints so much, break up the string into lines |
| 11 | for line in string.splitlines(): |
| 12 | print(line) |
no test coverage detected