Files
scylladb/tasks/types.hh
Aleksandra Martyniuk 5a948d3fac tasks: initialize shard in task_info ctor
Initialize shard in task_info constructor. All current usages do
not care about the shard of an empty task_info.

In the following patches we may need that for setting info about
virtual task parent.
2025-01-10 10:03:08 +01:00

30 lines
532 B
C++

/*
* Copyright (C) 2022-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
#include "utils/UUID.hh"
namespace tasks {
using task_id = utils::tagged_uuid<struct task_id_tag>;
struct task_info {
task_id id;
unsigned shard;
task_info() noexcept : id(task_id::create_null_id()), shard(0) {}
task_info(task_id id, unsigned parent_shard) noexcept : id(id), shard(parent_shard) {}
operator bool() const noexcept {
return bool(id);
}
};
}