Kernel: Properly keep track of mutex lock data in the guest memory. This fixes userland locking/unlocking.

This commit is contained in:
Subv 2018-01-08 14:12:03 -05:00 committed by bunnei
parent 2a3f8e8484
commit 1bbe9309da
4 changed files with 63 additions and 67 deletions

View file

@ -257,10 +257,9 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeMutex::GetChildren() const {
std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren());
const auto& mutex = static_cast<const Kernel::Mutex&>(object);
if (mutex.lock_count) {
list.push_back(
std::make_unique<WaitTreeText>(tr("locked %1 times by thread:").arg(mutex.lock_count)));
list.push_back(std::make_unique<WaitTreeThread>(*mutex.holding_thread));
if (mutex.GetHasWaiters()) {
list.push_back(std::make_unique<WaitTreeText>(tr("locked by thread:")));
list.push_back(std::make_unique<WaitTreeThread>(*mutex.GetHoldingThread()));
} else {
list.push_back(std::make_unique<WaitTreeText>(tr("free")));
}