JsrtThreadService.h 1017 B

12345678910111213141516171819202122232425262728
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. #include "Base/ThreadServiceWrapperBase.h"
  7. class JsrtThreadService : public ThreadServiceWrapperBase
  8. {
  9. public:
  10. JsrtThreadService();
  11. ~JsrtThreadService();
  12. bool Initialize(ThreadContext *threadContext);
  13. unsigned int Idle();
  14. // Does nothing, we don't force idle collection for JSRT
  15. void SetForceOneIdleCollection() override {}
  16. private:
  17. bool CanScheduleIdleCollect() override { return true; }
  18. bool OnScheduleIdleCollect(uint ticks, bool scheduleAsTask) override;
  19. void OnFinishIdleCollect() override;
  20. bool ShouldFinishConcurrentCollectOnIdleCallback() override;
  21. unsigned int nextIdleTick;
  22. };