diff --git a/mesosphere/include/mesosphere/processes/KProcess.hpp b/mesosphere/include/mesosphere/processes/KProcess.hpp index 13cd14bca..eaa1ce9fc 100644 --- a/mesosphere/include/mesosphere/processes/KProcess.hpp +++ b/mesosphere/include/mesosphere/processes/KProcess.hpp @@ -7,13 +7,14 @@ class KResourceLimit; #include #include #include +#include namespace mesosphere { class KProcess final : public KSynchronizationObject /* FIXME */ { public: - MESOSPHERE_AUTO_OBJECT_TRAITS(AutoObject, Process); + MESOSPHERE_AUTO_OBJECT_TRAITS(SynchronizationObject, Process); enum class State : uint { Created = 0, diff --git a/mesosphere/include/mesosphere/threading/KThread.hpp b/mesosphere/include/mesosphere/threading/KThread.hpp index 475ef05dc..dd9cee705 100644 --- a/mesosphere/include/mesosphere/threading/KThread.hpp +++ b/mesosphere/include/mesosphere/threading/KThread.hpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include @@ -144,18 +144,13 @@ class KThread final : } KProcess *GetOwner() const { return owner; } - bool IsSchedulerOperationRedundant() const { return owner != nullptr && owner->GetSchedulerOperationCount() == redundantSchedulerOperationCount; } + bool IsSchedulerOperationRedundant() const; - void IncrementSchedulerOperationCount() { if (owner != nullptr) owner->IncrementSchedulerOperationCount(); } - void SetRedundantSchedulerOperation() { redundantSchedulerOperationCount = owner != nullptr ? owner->GetSchedulerOperationCount() : redundantSchedulerOperationCount; } + void IncrementSchedulerOperationCount(); + void SetRedundantSchedulerOperation(); void SetCurrentCoreId(int coreId) { currentCoreId = coreId; } - void SetProcessLastThreadAndIdleSelectionCount(ulong idleSelectionCount) - { - if (owner != nullptr) { - owner->SetLastThreadAndIdleSelectionCount(this, idleSelectionCount); - } - } + void SetProcessLastThreadAndIdleSelectionCount(ulong idleSelectionCount); void UpdateLastScheduledTime() { ++lastScheduledTime; /* FIXME */} diff --git a/mesosphere/source/processes/KHandleTable.cpp b/mesosphere/source/processes/KHandleTable.cpp index a31e1a693..0d7905b3f 100644 --- a/mesosphere/source/processes/KHandleTable.cpp +++ b/mesosphere/source/processes/KHandleTable.cpp @@ -2,6 +2,7 @@ #include #include #include +#include namespace mesosphere { diff --git a/mesosphere/source/threading/KThread.cpp b/mesosphere/source/threading/KThread.cpp index 83588a34a..f6e8ed4c8 100644 --- a/mesosphere/source/threading/KThread.cpp +++ b/mesosphere/source/threading/KThread.cpp @@ -3,6 +3,7 @@ #include #include +#include #include namespace mesosphere @@ -13,6 +14,30 @@ void KThread::OnAlarm() CancelKernelSync(); } +bool KThread::IsSchedulerOperationRedundant() const +{ + return owner != nullptr && owner->GetSchedulerOperationCount() == redundantSchedulerOperationCount; +} + +void KThread::IncrementSchedulerOperationCount() +{ + if (owner != nullptr) { + owner->IncrementSchedulerOperationCount(); + } +} + +void KThread::SetRedundantSchedulerOperation() +{ + redundantSchedulerOperationCount = owner != nullptr ? owner->GetSchedulerOperationCount() : redundantSchedulerOperationCount; +} + +void KThread::SetProcessLastThreadAndIdleSelectionCount(ulong idleSelectionCount) +{ + if (owner != nullptr) { + owner->SetLastThreadAndIdleSelectionCount(this, idleSelectionCount); + } +} + void KThread::AdjustScheduling(ushort oldMaskFull) { if (currentSchedMaskFull == oldMaskFull) {