[zion] Update LinkedList iterator semantics.
This commit is contained in:
parent
242a18ae3c
commit
b27672d5de
|
@ -13,7 +13,7 @@ RefPtr<Capability> CapabilityTable::GetCapability(uint64_t id) {
|
||||||
MutexHolder h(lock_);
|
MutexHolder h(lock_);
|
||||||
auto iter = capabilities_.begin();
|
auto iter = capabilities_.begin();
|
||||||
while (iter != capabilities_.end()) {
|
while (iter != capabilities_.end()) {
|
||||||
if (*iter && iter->id() == id) {
|
if (*iter && (*iter)->id() == id) {
|
||||||
return *iter;
|
return *iter;
|
||||||
}
|
}
|
||||||
++iter;
|
++iter;
|
||||||
|
@ -27,7 +27,7 @@ RefPtr<Capability> CapabilityTable::ReleaseCapability(uint64_t id) {
|
||||||
MutexHolder h(lock_);
|
MutexHolder h(lock_);
|
||||||
auto iter = capabilities_.begin();
|
auto iter = capabilities_.begin();
|
||||||
while (iter != capabilities_.end()) {
|
while (iter != capabilities_.end()) {
|
||||||
if (*iter && iter->id() == id) {
|
if (*iter && (*iter)->id() == id) {
|
||||||
// FIXME: Do an actual release here.
|
// FIXME: Do an actual release here.
|
||||||
auto cap = *iter;
|
auto cap = *iter;
|
||||||
*iter = {nullptr};
|
*iter = {nullptr};
|
||||||
|
|
|
@ -88,7 +88,7 @@ class LinkedList {
|
||||||
}
|
}
|
||||||
|
|
||||||
T& operator*() { return item_->item; }
|
T& operator*() { return item_->item; }
|
||||||
T& operator->() { return item_->item; }
|
T* operator->() { return &item_->item; }
|
||||||
bool operator==(const Iterator& other) { return item_ == other.item_; }
|
bool operator==(const Iterator& other) { return item_ == other.item_; }
|
||||||
bool operator!=(const Iterator& other) { return item_ != other.item_; }
|
bool operator!=(const Iterator& other) { return item_ != other.item_; }
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ RefPtr<Thread> Process::GetThread(uint64_t tid) {
|
||||||
MutexHolder lock(mutex_);
|
MutexHolder lock(mutex_);
|
||||||
auto iter = threads_.begin();
|
auto iter = threads_.begin();
|
||||||
while (iter != threads_.end()) {
|
while (iter != threads_.end()) {
|
||||||
if (iter->tid() == tid) {
|
if ((*iter)->tid() == tid) {
|
||||||
return *iter;
|
return *iter;
|
||||||
}
|
}
|
||||||
++iter;
|
++iter;
|
||||||
|
@ -55,7 +55,7 @@ void Process::CheckState() {
|
||||||
MutexHolder lock(mutex_);
|
MutexHolder lock(mutex_);
|
||||||
auto iter = threads_.begin();
|
auto iter = threads_.begin();
|
||||||
while (iter != threads_.end()) {
|
while (iter != threads_.end()) {
|
||||||
if (iter->GetState() != Thread::FINISHED) {
|
if ((*iter)->GetState() != Thread::FINISHED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
++iter;
|
++iter;
|
||||||
|
|
|
@ -14,7 +14,7 @@ void ProcessManager::InsertProcess(const RefPtr<Process>& proc) {
|
||||||
Process& ProcessManager::FromId(uint64_t pid) {
|
Process& ProcessManager::FromId(uint64_t pid) {
|
||||||
auto iter = proc_list_.begin();
|
auto iter = proc_list_.begin();
|
||||||
while (iter != proc_list_.end()) {
|
while (iter != proc_list_.end()) {
|
||||||
if (iter->id() == pid) {
|
if ((*iter)->id() == pid) {
|
||||||
return **iter;
|
return **iter;
|
||||||
}
|
}
|
||||||
++iter;
|
++iter;
|
||||||
|
@ -28,7 +28,7 @@ void ProcessManager::DumpProcessStates() {
|
||||||
dbgln("Process States: %u", proc_list_.size());
|
dbgln("Process States: %u", proc_list_.size());
|
||||||
auto iter = proc_list_.begin();
|
auto iter = proc_list_.begin();
|
||||||
while (iter != proc_list_.end()) {
|
while (iter != proc_list_.end()) {
|
||||||
dbgln("%u: %u", iter->id(), iter->GetState());
|
dbgln("%u: %u", (*iter)->id(), (*iter)->GetState());
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue