From f07a6606e44d7bba88efa55615075a917704bde1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Jul 2022 17:01:18 +0200 Subject: Set builtin result while holding mutex While the original code was probably correct, there is suspicion this is causing a TSAN false-positive. --- libbutl/builtin.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libbutl/builtin.cxx') diff --git a/libbutl/builtin.cxx b/libbutl/builtin.cxx index b13a59a..6f451bf 100644 --- a/libbutl/builtin.cxx +++ b/libbutl/builtin.cxx @@ -2177,17 +2177,17 @@ namespace butl { unique_ptr s ( new builtin::async_state ( + r, [fn, - &r, &args, in = move (in), out = move (out), err = move (err), &cwd, - &cbs] () mutable noexcept + &cbs] () mutable noexcept -> uint8_t { - r = fn (args, - move (in), move (out), move (err), - cwd, - cbs); + return fn (args, + move (in), move (out), move (err), + cwd, + cbs); })); return builtin (r, move (s)); -- cgit v1.1