manager: rework the timestamps logic, so that they are an enum-index array

This makes things quite a bit more systematic I think, as we can
systematically operate on all timestamps, for example for the purpose of
serialization/deserialization.

This rework doesn't necessarily make things shorter in the individual
lines, but it does reduce the line count a bit.

(This is useful particularly when we want to add additional timestamps,
for example to solve #7023)
This commit is contained in:
Lennart Poettering
2017-11-21 10:22:28 +01:00
parent 172378e01b
commit 9f9f034271
5 changed files with 113 additions and 93 deletions
+1 -1
View File
@@ -419,7 +419,7 @@ static void timer_enter_waiting(Timer *t, bool initial) {
* our own startup. */
/* fall through */
case TIMER_STARTUP:
base = UNIT(t)->manager->userspace_timestamp.monotonic;
base = UNIT(t)->manager->timestamps[MANAGER_TIMESTAMP_USERSPACE].monotonic;
break;
case TIMER_UNIT_ACTIVE: