private: // Update the updated_target_run_time_, the task processor will re-insert the task when it is // popped and update the target_run_time_. void SetTargetRunTime(uint64_t new_target_run_time) {
target_run_time_ = new_target_run_time;
}
// Time in ns at which we want the task to run.
uint64_t target_run_time_;
// Used to process GC tasks (heap trim, heap transitions, concurrent GC). class TaskProcessor { public:
TaskProcessor(); virtual ~TaskProcessor(); void AddTask(Thread* self, HeapTask* task) REQUIRES(!lock_);
HeapTask* GetTask(Thread* self) REQUIRES(!lock_); void Start(Thread* self) REQUIRES(!lock_); // Stop tells the RunAllTasks to finish up the remaining tasks as soon as // possible then return. void Stop(Thread* self) REQUIRES(!lock_); void RunAllTasks(Thread* self) REQUIRES(!lock_); bool IsRunning() const REQUIRES(!lock_); void UpdateTargetRunTime(Thread* self, HeapTask* target_time, uint64_t new_target_time)
REQUIRES(!lock_); // Is the given thread the task processor thread? // If wait is true, and no thread has been registered via Start(), we briefly // wait for one to be registered. If we time out, we return true. bool IsRunningThread(Thread* t, bool wait = false) REQUIRES(!lock_);
private: // Wait briefly for running_thread_ to become non-null. Return false on timeout. bool WaitForThread(Thread* self) REQUIRES(lock_);
class CompareByTargetRunTime { public: booloperator()(const HeapTask* a, const HeapTask* b) const { return a->GetTargetRunTime() < b->GetTargetRunTime();
}
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.