diff options
| author | 2014-12-29 10:55:30 -0200 | |
|---|---|---|
| committer | 2015-01-09 19:43:52 -0200 | |
| commit | 8ad41775ccae67e54e9f03cbe054d7562b1c66ce (patch) | |
| tree | 79d176bd9805cae0a2cfdd12e4c91c108bec0c8d /src/core/hle/kernel/mutex.cpp | |
| parent | Kernel: Don't re-assign object's handle when duplicating one (diff) | |
| download | yuzu-8ad41775ccae67e54e9f03cbe054d7562b1c66ce.tar.gz yuzu-8ad41775ccae67e54e9f03cbe054d7562b1c66ce.tar.xz yuzu-8ad41775ccae67e54e9f03cbe054d7562b1c66ce.zip | |
Kernel: Start using boost::intrusive_ptr for lifetime management
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 7d008f6cc..853a5dd74 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -48,7 +48,7 @@ void MutexAcquireLock(Mutex* mutex, Handle thread = GetCurrentThread()->GetHandl | |||
| 48 | bool ReleaseMutexForThread(Mutex* mutex, Handle thread_handle) { | 48 | bool ReleaseMutexForThread(Mutex* mutex, Handle thread_handle) { |
| 49 | MutexAcquireLock(mutex, thread_handle); | 49 | MutexAcquireLock(mutex, thread_handle); |
| 50 | 50 | ||
| 51 | Thread* thread = Kernel::g_handle_table.Get<Thread>(thread_handle); | 51 | Thread* thread = Kernel::g_handle_table.Get<Thread>(thread_handle).get(); |
| 52 | if (thread == nullptr) { | 52 | if (thread == nullptr) { |
| 53 | LOG_ERROR(Kernel, "Called with invalid handle: %08X", thread_handle); | 53 | LOG_ERROR(Kernel, "Called with invalid handle: %08X", thread_handle); |
| 54 | return false; | 54 | return false; |
| @@ -94,7 +94,7 @@ void ReleaseThreadMutexes(Handle thread) { | |||
| 94 | 94 | ||
| 95 | // Release every mutex that the thread holds, and resume execution on the waiting threads | 95 | // Release every mutex that the thread holds, and resume execution on the waiting threads |
| 96 | for (MutexMap::iterator iter = locked.first; iter != locked.second; ++iter) { | 96 | for (MutexMap::iterator iter = locked.first; iter != locked.second; ++iter) { |
| 97 | Mutex* mutex = g_handle_table.Get<Mutex>(iter->second); | 97 | Mutex* mutex = g_handle_table.Get<Mutex>(iter->second).get(); |
| 98 | ResumeWaitingThread(mutex); | 98 | ResumeWaitingThread(mutex); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| @@ -122,7 +122,7 @@ bool ReleaseMutex(Mutex* mutex) { | |||
| 122 | * @param handle Handle to mutex to release | 122 | * @param handle Handle to mutex to release |
| 123 | */ | 123 | */ |
| 124 | ResultCode ReleaseMutex(Handle handle) { | 124 | ResultCode ReleaseMutex(Handle handle) { |
| 125 | Mutex* mutex = Kernel::g_handle_table.Get<Mutex>(handle); | 125 | Mutex* mutex = Kernel::g_handle_table.Get<Mutex>(handle).get(); |
| 126 | if (mutex == nullptr) return InvalidHandle(ErrorModule::Kernel); | 126 | if (mutex == nullptr) return InvalidHandle(ErrorModule::Kernel); |
| 127 | 127 | ||
| 128 | if (!ReleaseMutex(mutex)) { | 128 | if (!ReleaseMutex(mutex)) { |