kernel/condition_variable: Reorder some methods.

This way the static functions (used only in KDL) are below
the actual notification methods, which are now all grouped
together in one place.

No functional change.
This commit is contained in:
Augustin Cavalier 2019-08-03 11:12:06 -04:00
parent 6cb38c6319
commit 489612d43f

View File

@ -282,37 +282,6 @@ ConditionVariable::NotifyAll(const void* object, status_t result)
}
/*static*/ void
ConditionVariable::ListAll()
{
kprintf(" variable object (type) waiting threads\n");
kprintf("------------------------------------------------------------\n");
ConditionVariableHash::Iterator it(&sConditionVariableHash);
while (ConditionVariable* variable = it.Next()) {
// count waiting threads
int count = variable->fEntries.Count();
kprintf("%p %p %-20s %15d\n", variable, variable->fObject,
variable->fObjectType, count);
}
}
void
ConditionVariable::Dump() const
{
kprintf("condition variable %p\n", this);
kprintf(" object: %p (%s)\n", fObject, fObjectType);
kprintf(" threads:");
for (EntryList::ConstIterator it = fEntries.GetIterator();
ConditionVariableEntry* entry = it.Next();) {
kprintf(" %" B_PRId32, entry->fThread->id);
}
kprintf("\n");
}
void
ConditionVariable::_Notify(bool all, status_t result)
{
@ -355,6 +324,37 @@ ConditionVariable::_NotifyLocked(bool all, status_t result)
}
/*static*/ void
ConditionVariable::ListAll()
{
kprintf(" variable object (type) waiting threads\n");
kprintf("------------------------------------------------------------\n");
ConditionVariableHash::Iterator it(&sConditionVariableHash);
while (ConditionVariable* variable = it.Next()) {
// count waiting threads
int count = variable->fEntries.Count();
kprintf("%p %p %-20s %15d\n", variable, variable->fObject,
variable->fObjectType, count);
}
}
void
ConditionVariable::Dump() const
{
kprintf("condition variable %p\n", this);
kprintf(" object: %p (%s)\n", fObject, fObjectType);
kprintf(" threads:");
for (EntryList::ConstIterator it = fEntries.GetIterator();
ConditionVariableEntry* entry = it.Next();) {
kprintf(" %" B_PRId32, entry->fThread->id);
}
kprintf("\n");
}
// #pragma mark -