diff options
| author | 2015-01-11 01:20:49 -0200 | |
|---|---|---|
| committer | 2015-01-30 11:47:01 -0200 | |
| commit | 9a345de2bd73c280de16442f78a313c1b6bee84c (patch) | |
| tree | e28e8dee9dd183aa08e8b47141a2887cb834757e /src/core/hle/kernel/mutex.cpp | |
| parent | Merge pull request #412 from purpasmart96/svc_table_cleanup (diff) | |
| download | yuzu-9a345de2bd73c280de16442f78a313c1b6bee84c.tar.gz yuzu-9a345de2bd73c280de16442f78a313c1b6bee84c.tar.xz yuzu-9a345de2bd73c280de16442f78a313c1b6bee84c.zip | |
Kernel: Remove useless/duplicated comments; mark functions static
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index cd05a1397..c94c2acc9 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -40,7 +40,7 @@ static MutexMap g_mutex_held_locks; | |||
| 40 | * @param mutex Mutex that is to be acquired | 40 | * @param mutex Mutex that is to be acquired |
| 41 | * @param thread Thread that will acquire the mutex | 41 | * @param thread Thread that will acquire the mutex |
| 42 | */ | 42 | */ |
| 43 | void MutexAcquireLock(Mutex* mutex, Thread* thread) { | 43 | static void MutexAcquireLock(Mutex* mutex, Thread* thread) { |
| 44 | g_mutex_held_locks.insert(std::make_pair(thread, mutex)); | 44 | g_mutex_held_locks.insert(std::make_pair(thread, mutex)); |
| 45 | mutex->holding_thread = thread; | 45 | mutex->holding_thread = thread; |
| 46 | } | 46 | } |
| @@ -49,7 +49,7 @@ void MutexAcquireLock(Mutex* mutex, Thread* thread) { | |||
| 49 | * Resumes a thread waiting for the specified mutex | 49 | * Resumes a thread waiting for the specified mutex |
| 50 | * @param mutex The mutex that some thread is waiting on | 50 | * @param mutex The mutex that some thread is waiting on |
| 51 | */ | 51 | */ |
| 52 | void ResumeWaitingThread(Mutex* mutex) { | 52 | static void ResumeWaitingThread(Mutex* mutex) { |
| 53 | // Find the next waiting thread for the mutex... | 53 | // Find the next waiting thread for the mutex... |
| 54 | auto next_thread = mutex->WakeupNextThread(); | 54 | auto next_thread = mutex->WakeupNextThread(); |
| 55 | if (next_thread != nullptr) { | 55 | if (next_thread != nullptr) { |
| @@ -73,7 +73,7 @@ void ReleaseThreadMutexes(Thread* thread) { | |||
| 73 | g_mutex_held_locks.erase(thread); | 73 | g_mutex_held_locks.erase(thread); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | bool ReleaseMutex(Mutex* mutex) { | 76 | static bool ReleaseMutex(Mutex* mutex) { |
| 77 | if (mutex->locked) { | 77 | if (mutex->locked) { |
| 78 | auto locked = g_mutex_held_locks.equal_range(mutex->holding_thread); | 78 | auto locked = g_mutex_held_locks.equal_range(mutex->holding_thread); |
| 79 | 79 | ||
| @@ -89,10 +89,6 @@ bool ReleaseMutex(Mutex* mutex) { | |||
| 89 | return true; | 89 | return true; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | /** | ||
| 93 | * Releases a mutex | ||
| 94 | * @param handle Handle to mutex to release | ||
| 95 | */ | ||
| 96 | ResultCode ReleaseMutex(Handle handle) { | 92 | ResultCode ReleaseMutex(Handle handle) { |
| 97 | Mutex* mutex = Kernel::g_handle_table.Get<Mutex>(handle).get(); | 93 | Mutex* mutex = Kernel::g_handle_table.Get<Mutex>(handle).get(); |
| 98 | if (mutex == nullptr) return InvalidHandle(ErrorModule::Kernel); | 94 | if (mutex == nullptr) return InvalidHandle(ErrorModule::Kernel); |
| @@ -113,7 +109,7 @@ ResultCode ReleaseMutex(Handle handle) { | |||
| 113 | * @param name Optional name of mutex | 109 | * @param name Optional name of mutex |
| 114 | * @return Pointer to new Mutex object | 110 | * @return Pointer to new Mutex object |
| 115 | */ | 111 | */ |
| 116 | Mutex* CreateMutex(Handle& handle, bool initial_locked, const std::string& name) { | 112 | static Mutex* CreateMutex(Handle& handle, bool initial_locked, const std::string& name) { |
| 117 | Mutex* mutex = new Mutex; | 113 | Mutex* mutex = new Mutex; |
| 118 | // TODO(yuriks): Fix error reporting | 114 | // TODO(yuriks): Fix error reporting |
| 119 | handle = Kernel::g_handle_table.Create(mutex).ValueOr(INVALID_HANDLE); | 115 | handle = Kernel::g_handle_table.Create(mutex).ValueOr(INVALID_HANDLE); |
| @@ -129,12 +125,6 @@ Mutex* CreateMutex(Handle& handle, bool initial_locked, const std::string& name) | |||
| 129 | return mutex; | 125 | return mutex; |
| 130 | } | 126 | } |
| 131 | 127 | ||
| 132 | /** | ||
| 133 | * Creates a mutex | ||
| 134 | * @param initial_locked Specifies if the mutex should be locked initially | ||
| 135 | * @param name Optional name of mutex | ||
| 136 | * @return Handle to newly created object | ||
| 137 | */ | ||
| 138 | Handle CreateMutex(bool initial_locked, const std::string& name) { | 128 | Handle CreateMutex(bool initial_locked, const std::string& name) { |
| 139 | Handle handle; | 129 | Handle handle; |
| 140 | Mutex* mutex = CreateMutex(handle, initial_locked, name); | 130 | Mutex* mutex = CreateMutex(handle, initial_locked, name); |