diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-05-13 09:02:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-05-13 09:02:17 +0200 |
commit | ad9cdb9b172ecd7acf5e55b60f3f77626d72f14f (patch) | |
tree | bf26ce2bad2efdae443a03cbe7874621f4dc31cc /libbuild2/scheduler.txx | |
parent | a77a968800ba36cb04fb58c73e768f5ec137b45c (diff) |
Do lazy allocation of shadow task queues
Diffstat (limited to 'libbuild2/scheduler.txx')
-rw-r--r-- | libbuild2/scheduler.txx | 3 |
1 files changed, 3 insertions, 0 deletions
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). |