diff options
| author | 2014-05-27 22:42:16 -0400 | |
|---|---|---|
| committer | 2014-05-27 22:42:16 -0400 | |
| commit | 2ed6652f100fdbc5ad7d72a0602dc2c99ef79cce (patch) | |
| tree | d57f9249ca490d8b2d4cbff3708a4714becb2400 /src/core/hle/kernel/mutex.cpp | |
| parent | svc: implemented WaitSynchronization1, WaitSynchronizationN, and CreateEvent (diff) | |
| download | yuzu-2ed6652f100fdbc5ad7d72a0602dc2c99ef79cce.tar.gz yuzu-2ed6652f100fdbc5ad7d72a0602dc2c99ef79cce.tar.xz yuzu-2ed6652f100fdbc5ad7d72a0602dc2c99ef79cce.zip | |
mutex: added preliminary SyncRequest/WaitSynchronization, added some comments/assertions
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 17fd40acd..23c064571 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -31,6 +31,7 @@ public: | |||
| 31 | */ | 31 | */ |
| 32 | Result SyncRequest(bool* wait) { | 32 | Result SyncRequest(bool* wait) { |
| 33 | // TODO(bunnei): ImplementMe | 33 | // TODO(bunnei): ImplementMe |
| 34 | locked = true; | ||
| 34 | return 0; | 35 | return 0; |
| 35 | } | 36 | } |
| 36 | 37 | ||
| @@ -41,6 +42,7 @@ public: | |||
| 41 | */ | 42 | */ |
| 42 | Result WaitSynchronization(bool* wait) { | 43 | Result WaitSynchronization(bool* wait) { |
| 43 | // TODO(bunnei): ImplementMe | 44 | // TODO(bunnei): ImplementMe |
| 45 | *wait = locked; | ||
| 44 | return 0; | 46 | return 0; |
| 45 | } | 47 | } |
| 46 | }; | 48 | }; |
| @@ -111,6 +113,9 @@ bool ReleaseMutex(Mutex* mutex) { | |||
| 111 | */ | 113 | */ |
| 112 | Result ReleaseMutex(Handle handle) { | 114 | Result ReleaseMutex(Handle handle) { |
| 113 | Mutex* mutex = Kernel::g_object_pool.GetFast<Mutex>(handle); | 115 | Mutex* mutex = Kernel::g_object_pool.GetFast<Mutex>(handle); |
| 116 | |||
| 117 | _assert_msg_(KERNEL, mutex, "ReleaseMutex tried to release a NULL mutex!"); | ||
| 118 | |||
| 114 | if (!ReleaseMutex(mutex)) { | 119 | if (!ReleaseMutex(mutex)) { |
| 115 | return -1; | 120 | return -1; |
| 116 | } | 121 | } |
| @@ -121,6 +126,7 @@ Result ReleaseMutex(Handle handle) { | |||
| 121 | * Creates a mutex | 126 | * Creates a mutex |
| 122 | * @param handle Reference to handle for the newly created mutex | 127 | * @param handle Reference to handle for the newly created mutex |
| 123 | * @param initial_locked Specifies if the mutex should be locked initially | 128 | * @param initial_locked Specifies if the mutex should be locked initially |
| 129 | * @return Pointer to new Mutex object | ||
| 124 | */ | 130 | */ |
| 125 | Mutex* CreateMutex(Handle& handle, bool initial_locked) { | 131 | Mutex* CreateMutex(Handle& handle, bool initial_locked) { |
| 126 | Mutex* mutex = new Mutex; | 132 | Mutex* mutex = new Mutex; |