aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-06-12 10:12:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-06-12 10:12:41 +0200
commitb67c93f4794b06b57b9601b96421289acadadc6b (patch)
tree0bd7b5cfc6ba1101c503a8582406e48692df97d6 /build2
parentd5cda1f5ca58a11f8dec36b2ad29ffe09064d4fd (diff)
Reimplement thread thunking with lambda; this helps Clang 5.0/trunk
Diffstat (limited to 'build2')
-rw-r--r--build2/test/script/builtin.cxx28
1 files changed, 10 insertions, 18 deletions
diff --git a/build2/test/script/builtin.cxx b/build2/test/script/builtin.cxx
index d45b200..62f011b 100644
--- a/build2/test/script/builtin.cxx
+++ b/build2/test/script/builtin.cxx
@@ -1348,32 +1348,24 @@ namespace build2
return 1;
}
- static void
- thread_thunk (builtin_impl* fn,
- scope& sp,
- const strings& args,
- auto_fd in, auto_fd out, auto_fd err,
- uint8_t& r) noexcept
- {
- r = fn (sp, args, move (in), move (out), move (err));
- }
-
// Run builtin implementation asynchronously.
//
static builtin
- async_impl (builtin_impl fn,
+ async_impl (builtin_impl* fn,
scope& sp,
uint8_t& r,
const strings& args,
auto_fd in, auto_fd out, auto_fd err)
{
- return builtin (r,
- thread (thread_thunk,
- fn,
- ref (sp),
- cref (args),
- move (in), move (out), move (err),
- ref (r)));
+ return builtin (
+ r,
+ thread ([&fn, &sp, &r, &args,
+ in = move (in),
+ out = move (out),
+ err = move (err)] () mutable noexcept
+ {
+ r = fn (sp, args, move (in), move (out), move (err));
+ }));
}
template <builtin_impl fn>