| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "cgroup.h" |
| 5 |
#include "core-forward.h" |
| 6 |
#include "unit.h" |
| 7 |
|
| 8 |
typedef struct Slice { |
| 9 |
Unit meta; |
| 10 |
|
| 11 |
SliceState state, deserialized_state; |
| 12 |
|
| 13 |
unsigned concurrency_soft_max; |
| 14 |
unsigned concurrency_hard_max; |
| 15 |
|
| 16 |
CGroupContext cgroup_context; |
| 17 |
|
| 18 |
CGroupRuntime *cgroup_runtime; |
| 19 |
} Slice; |
| 20 |
|
| 21 |
extern const UnitVTable slice_vtable; |
| 22 |
|
| 23 |
DEFINE_CAST(SLICE, Slice); |
| 24 |
|
| 25 |
unsigned slice_get_currently_active(Slice *slice, Unit *ignore, bool with_pending); |
| 26 |
|
| 27 |
bool slice_concurrency_hard_max_reached(Slice *slice, Unit *ignore); |
| 28 |
bool slice_concurrency_soft_max_reached(Slice *slice, Unit *ignore); |