summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/mutex.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-01-08 20:12:03 +0100
committerbunnei <bunneidev@gmail.com>2018-01-09 03:12:51 +0100
commit1bbe9309daa96b5fbac7a2df5a2edcb17ab7a05c (patch)
tree71a8fc9f6ab552fb242923372238f691caa4e3d6 /src/core/hle/kernel/mutex.h
parentKernel: Allow chaining WaitSynchronization calls inside a wakeup callback. (diff)
downloadyuzu-1bbe9309daa96b5fbac7a2df5a2edcb17ab7a05c.tar
yuzu-1bbe9309daa96b5fbac7a2df5a2edcb17ab7a05c.tar.gz
yuzu-1bbe9309daa96b5fbac7a2df5a2edcb17ab7a05c.tar.bz2
yuzu-1bbe9309daa96b5fbac7a2df5a2edcb17ab7a05c.tar.lz
yuzu-1bbe9309daa96b5fbac7a2df5a2edcb17ab7a05c.tar.xz
yuzu-1bbe9309daa96b5fbac7a2df5a2edcb17ab7a05c.tar.zst
yuzu-1bbe9309daa96b5fbac7a2df5a2edcb17ab7a05c.zip
Diffstat (limited to 'src/core/hle/kernel/mutex.h')
-rw-r--r--src/core/hle/kernel/mutex.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h
index 87e3c15ee..49b6b454e 100644
--- a/src/core/hle/kernel/mutex.h
+++ b/src/core/hle/kernel/mutex.h
@@ -41,10 +41,8 @@ public:
return HANDLE_TYPE;
}
- int lock_count; ///< Number of times the mutex has been acquired
u32 priority; ///< The priority of the mutex, used for priority inheritance.
std::string name; ///< Name of mutex (optional)
- SharedPtr<Thread> holding_thread; ///< Thread that has acquired the mutex
VAddr guest_addr; ///< Address of the guest mutex value
/**
@@ -66,6 +64,19 @@ public:
*/
ResultCode Release(Thread* thread);
+ /// Gets the handle to the holding process stored in the guest state.
+ Handle GetOwnerHandle() const;
+
+ /// Gets the Thread pointed to by the owner handle
+ SharedPtr<Thread> GetHoldingThread() const;
+ /// Sets the holding process handle in the guest state.
+ void SetHoldingThread(SharedPtr<Thread> thread);
+
+ /// Returns the has_waiters bit in the guest state.
+ bool GetHasWaiters() const;
+ /// Sets the has_waiters bit in the guest state.
+ void SetHasWaiters(bool has_waiters);
+
private:
Mutex();
~Mutex() override;
@@ -79,12 +90,6 @@ private:
BitField<30, 1, u32_le> has_waiters;
};
static_assert(sizeof(GuestState) == 4, "GuestState size is incorrect");
-
- /// Updates the state of the object tracking this mutex in guest memory
- void UpdateGuestState();
-
- /// Verifies the state of the object tracking this mutex in guest memory
- void VerifyGuestState();
};
/**