Skip to content

Move CGroup pid fetching callback logic to the controller

David Edmundson requested to merge work/cgroup_pid_fix into master

The CGroup class started out as a dumb data store, that did some fetching of relevant data.

It then gained a more complex async operation. The lifepsan of the CGgroup object is managed by the model, so could get deleted whilst the runnable was running. QRunnables and non-qobjects leds to a lot of potential problems. There was a complex mutex and a wait condition, yet it still misses a case only solvable with yet more mutexes.

By moving the callback handling logic to the controller, we can guard everything in a safer more Qt manner without any overhead and with simpler code.

There is a behavioural change if you call pids whilst things are loading, but given a signal is emitted when pids load that's fine.

This class is exported, but the header was never installed. Whilst technically it is an ABI break it pragmantically will have no impact whatsoever.

BUG: 430615

Edited by David Edmundson

Merge request reports

Loading