Progress: avoid race on global_progress.draw_buffer

This commit is contained in:
Jacob Young 2024-07-14 23:08:21 -04:00
parent 9356cb1475
commit 14caccb477

View File

@ -669,14 +669,8 @@ fn appendTreeSymbol(symbol: TreeSymbol, buf: []u8, start_i: usize) usize {
fn clearWrittenWithEscapeCodes() anyerror!void {
if (!global_progress.need_clear) return;
var i: usize = 0;
const buf = global_progress.draw_buffer;
buf[i..][0..clear.len].* = clear.*;
i += clear.len;
global_progress.need_clear = false;
try write(buf[0..i]);
try write(clear);
}
/// U+25BA or