#pragma once class KThread; class KResourceLimit; #include #include #include #include namespace mesosphere { class KProcess final : public KAutoObject { public: MESOSPHERE_AUTO_OBJECT_TRAITS(AutoObject, Process); constexpr long GetSchedulerOperationCount() const { return schedulerOperationCount; } void IncrementSchedulerOperationCount() { ++schedulerOperationCount; } void SetLastThreadAndIdleSelectionCount(KThread *thread, ulong idleSelectionCount); const SharedPtr &GetResourceLimit() const { return reslimit; } KHandleTable &GetHandleTable() { return handleTable; } private: KThread *lastThreads[MAX_CORES]{nullptr}; ulong lastIdleSelectionCount[MAX_CORES]{0}; long schedulerOperationCount = -1; SharedPtr reslimit{}; KHandleTable handleTable{}; }; inline void intrusive_ptr_add_ref(KProcess *obj) { intrusive_ptr_add_ref((KAutoObject *)obj); } inline void intrusive_ptr_release(KProcess *obj) { intrusive_ptr_release((KAutoObject *)obj); } }