Commit 5c5242a6 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

mtr - synchronize output between different threads on Windows.

An attempt to fix lost output sometimes seen on buildbot.
parent a94d2a68
......@@ -87,12 +87,16 @@ sub flush_out {
$out_line = "";
}
use if $^O eq "MSWin32", "threads::shared";
my $flush_lock :shared;
# Print to stdout
sub print_out {
if(IS_WIN32PERL) {
$out_line .= $_[0];
# Flush buffered output on new lines.
if (rindex($_[0], "\n") != -1) {
lock($flush_lock);
flush_out();
}
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment