templatevoid Barrier::Increment<Barrier::kAllowHoldingLocks>(Thread* self, int delta); templatevoid Barrier::Increment<Barrier::kDisallowHoldingLocks>(Thread* self, int delta);
// Increment the count. If it becomes zero after the increment // then all the threads have already passed the barrier. If // it is non-zero then there is still one or more threads // that have not yet called the Pass function. When the // Pass function is called by the last thread, the count will // be decremented to zero and a Broadcast will be made on the // condition variable, thus waking this up. while (count_ != 0) { if (locks == kAllowHoldingLocks) {
condition_->WaitHoldingLocks(self);
} else {
condition_->Wait(self);
}
}
}
int Barrier::GetCount(Thread* self) {
MutexLock mu(self, *GetLock()); return count_;
}
void Barrier::SetCountLocked(Thread* self, int count) {
count_ = count; if (count == 0) {
condition_->Broadcast(self);
}
}
Barrier::~Barrier() { if (count_ != 0) { // Only check when not aborting and if we verify the count on shutdown.
LOG((gAborting == 0 && verify_count_on_shutdown_) ? FATAL : WARNING)
<< "Attempted to destroy barrier with non zero count " << count_;
}
}
} // namespace art
Messung V0.5 in Prozent
¤ 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.0.0Bemerkung:
(vorverarbeitet am 2026-06-29)
¤
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.