Files
systemd/src/core/slice.h
Daan De Meyer 4ea4abb651 core: Remove circular dependencies between headers
Currently there are various circular dependencies between headers
in core/. Let's get rid of these by making judicious use of forward
declarations and moving includes into implementation files instead of
having them in header files.

Getting rid of circular header includes simplifies the code and makes
various clang based tooling such as iwyu work much better on our code.

The most important change is getting rid of the manager.h include in
unit.h which is possible thanks to the previous commits. We also move
the OOMPolicy and StatusType enums to unit.h to remove the need for
other unit headers to include manager.h to get access to these enums.
2025-04-23 10:33:35 +02:00

27 lines
629 B
C

/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "unit.h"
typedef struct Slice {
Unit meta;
SliceState state, deserialized_state;
unsigned concurrency_soft_max;
unsigned concurrency_hard_max;
CGroupContext cgroup_context;
CGroupRuntime *cgroup_runtime;
} Slice;
extern const UnitVTable slice_vtable;
DEFINE_CAST(SLICE, Slice);
unsigned slice_get_currently_active(Slice *slice, Unit *ignore, bool with_pending);
bool slice_concurrency_hard_max_reached(Slice *slice, Unit *ignore);
bool slice_concurrency_soft_max_reached(Slice *slice, Unit *ignore);