From ad9cdb9b172ecd7acf5e55b60f3f77626d72f14f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 May 2021 09:02:17 +0200 Subject: Do lazy allocation of shadow task queues --- libbuild2/scheduler.txx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libbuild2/scheduler.txx') diff --git a/libbuild2/scheduler.txx b/libbuild2/scheduler.txx index 9cfc411..5c6b339 100644 --- a/libbuild2/scheduler.txx +++ b/libbuild2/scheduler.txx @@ -54,6 +54,9 @@ namespace build2 if (tq->shutdown) throw_generic_error (ECANCELED); + if (tq->data == nullptr) + tq->data.reset (new task_data[task_queue_depth_]); + if (task_data* td = push (*tq)) { // Package the task (under lock). -- cgit v1.1