summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2015-01-20 18:20:47 -0500
committerGravatar bunnei2015-01-21 20:48:30 -0500
commitf09806aed24b2f7de7d969cbfdb3b9d18ab90c61 (patch)
tree2c8ae1e650954dcc7342179a0e3202cd64fae8cf /src
parentKernel: Changed "ShouldWait" to return bool and "Acquire" to return void. (diff)
downloadyuzu-f09806aed24b2f7de7d969cbfdb3b9d18ab90c61.tar.gz
yuzu-f09806aed24b2f7de7d969cbfdb3b9d18ab90c61.tar.xz
yuzu-f09806aed24b2f7de7d969cbfdb3b9d18ab90c61.zip
Kernel: Renamed some functions for clarity.
- ReleaseNextThread->WakeupNextThread - ReleaseAllWaitingThreads->WakeupAllWaitingThreads.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/event.cpp2
-rw-r--r--src/core/hle/kernel/kernel.cpp2
-rw-r--r--src/core/hle/kernel/kernel.h8
-rw-r--r--src/core/hle/kernel/mutex.cpp2
-rw-r--r--src/core/hle/kernel/semaphore.cpp2
-rw-r--r--src/core/hle/kernel/thread.cpp2
-rw-r--r--src/core/hle/kernel/timer.cpp2
7 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp
index cdacba1d9..a48125965 100644
--- a/src/core/hle/kernel/event.cpp
+++ b/src/core/hle/kernel/event.cpp
@@ -47,7 +47,7 @@ ResultCode SignalEvent(const Handle handle) {
47 return InvalidHandle(ErrorModule::Kernel); 47 return InvalidHandle(ErrorModule::Kernel);
48 48
49 evt->signaled = true; 49 evt->signaled = true;
50 evt->ReleaseAllWaitingThreads(); 50 evt->WakeupAllWaitingThreads();
51 51
52 return RESULT_SUCCESS; 52 return RESULT_SUCCESS;
53} 53}
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 692349857..d7fa4dcea 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -30,7 +30,7 @@ void WaitObject::RemoveWaitingThread(Thread* thread) {
30 waiting_threads.erase(itr); 30 waiting_threads.erase(itr);
31} 31}
32 32
33Thread* WaitObject::ReleaseNextThread() { 33Thread* WaitObject::WakeupNextThread() {
34 if (waiting_threads.empty()) 34 if (waiting_threads.empty())
35 return nullptr; 35 return nullptr;
36 36
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index c26726223..3828efbea 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -138,13 +138,13 @@ public:
138 void RemoveWaitingThread(Thread* thead); 138 void RemoveWaitingThread(Thread* thead);
139 139
140 /** 140 /**
141 * Releases (and removes) the next thread waiting on this object 141 * Wake up the next thread waiting on this object
142 * @return Pointer to the thread that was resumed, nullptr if no threads are waiting 142 * @return Pointer to the thread that was resumed, nullptr if no threads are waiting
143 */ 143 */
144 Thread* ReleaseNextThread(); 144 Thread* WakeupNextThread();
145 145
146 /// Releases all threads waiting on this object 146 /// Wake up all threads waiting on this object
147 void ReleaseAllWaitingThreads(); 147 void WakeupAllWaitingThreads();
148 148
149private: 149private:
150 std::vector<Thread*> waiting_threads; ///< Threads waiting for this object to become available 150 std::vector<Thread*> waiting_threads; ///< Threads waiting for this object to become available
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index 355824e60..c170e55ff 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -53,7 +53,7 @@ void MutexAcquireLock(Mutex* mutex, Handle thread = GetCurrentThread()->GetHandl
53 */ 53 */
54void ResumeWaitingThread(Mutex* mutex) { 54void ResumeWaitingThread(Mutex* mutex) {
55 // Find the next waiting thread for the mutex... 55 // Find the next waiting thread for the mutex...
56 auto next_thread = mutex->ReleaseNextThread(); 56 auto next_thread = mutex->WakeupNextThread();
57 if (next_thread != nullptr) { 57 if (next_thread != nullptr) {
58 MutexAcquireLock(mutex, next_thread->GetHandle()); 58 MutexAcquireLock(mutex, next_thread->GetHandle());
59 } else { 59 } else {
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp
index 274680568..135d8fb2a 100644
--- a/src/core/hle/kernel/semaphore.cpp
+++ b/src/core/hle/kernel/semaphore.cpp
@@ -70,7 +70,7 @@ ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count) {
70 70
71 // Notify some of the threads that the semaphore has been released 71 // Notify some of the threads that the semaphore has been released
72 // stop once the semaphore is full again or there are no more waiting threads 72 // stop once the semaphore is full again or there are no more waiting threads
73 while (!semaphore->ShouldWait() && semaphore->ReleaseNextThread() != nullptr) { 73 while (!semaphore->ShouldWait() && semaphore->WakeupNextThread() != nullptr) {
74 semaphore->Acquire(); 74 semaphore->Acquire();
75 } 75 }
76 76
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 7a7f430cf..ab1126a36 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -104,7 +104,7 @@ void Thread::Stop(const char* reason) {
104 104
105 ChangeReadyState(this, false); 105 ChangeReadyState(this, false);
106 status = THREADSTATUS_DORMANT; 106 status = THREADSTATUS_DORMANT;
107 ReleaseAllWaitingThreads(); 107 WakeupAllWaitingThreads();
108 108
109 // Stopped threads are never waiting. 109 // Stopped threads are never waiting.
110 wait_objects.clear(); 110 wait_objects.clear();
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index 8d9db92a4..ec0b2c323 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -90,7 +90,7 @@ static void TimerCallback(u64 timer_handle, int cycles_late) {
90 timer->signaled = true; 90 timer->signaled = true;
91 91
92 // Resume all waiting threads 92 // Resume all waiting threads
93 timer->ReleaseAllWaitingThreads(); 93 timer->WakeupAllWaitingThreads();
94 94
95 if (timer->reset_type == RESETTYPE_ONESHOT) 95 if (timer->reset_type == RESETTYPE_ONESHOT)
96 timer->signaled = false; 96 timer->signaled = false;