mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
mtr - synchronize output between different threads on Windows.
An attempt to fix lost output sometimes seen on buildbot.
This commit is contained in:
parent
d912a6369c
commit
5abf0fea51
1 changed files with 4 additions and 0 deletions
|
@ -87,12 +87,16 @@ sub flush_out {
|
||||||
$out_line = "";
|
$out_line = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use if $^O eq "MSWin32", "threads::shared";
|
||||||
|
my $flush_lock :shared;
|
||||||
|
|
||||||
# Print to stdout
|
# Print to stdout
|
||||||
sub print_out {
|
sub print_out {
|
||||||
if(IS_WIN32PERL) {
|
if(IS_WIN32PERL) {
|
||||||
$out_line .= $_[0];
|
$out_line .= $_[0];
|
||||||
# Flush buffered output on new lines.
|
# Flush buffered output on new lines.
|
||||||
if (rindex($_[0], "\n") != -1) {
|
if (rindex($_[0], "\n") != -1) {
|
||||||
|
lock($flush_lock);
|
||||||
flush_out();
|
flush_out();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue