citra-emu
/
citra
Archived
1
0
Fork 0

Kernel: Renamed some functions for clarity.

- ReleaseNextThread->WakeupNextThread
- ReleaseAllWaitingThreads->WakeupAllWaitingThreads.
This commit is contained in:
bunnei 2015-01-20 18:20:47 -05:00
parent 15b6a4d9ad
commit f09806aed2
7 changed files with 10 additions and 10 deletions

View File

@ -47,7 +47,7 @@ ResultCode SignalEvent(const Handle handle) {
return InvalidHandle(ErrorModule::Kernel); return InvalidHandle(ErrorModule::Kernel);
evt->signaled = true; evt->signaled = true;
evt->ReleaseAllWaitingThreads(); evt->WakeupAllWaitingThreads();
return RESULT_SUCCESS; return RESULT_SUCCESS;
} }

View File

@ -30,7 +30,7 @@ void WaitObject::RemoveWaitingThread(Thread* thread) {
waiting_threads.erase(itr); waiting_threads.erase(itr);
} }
Thread* WaitObject::ReleaseNextThread() { Thread* WaitObject::WakeupNextThread() {
if (waiting_threads.empty()) if (waiting_threads.empty())
return nullptr; return nullptr;

View File

@ -138,13 +138,13 @@ public:
void RemoveWaitingThread(Thread* thead); void RemoveWaitingThread(Thread* thead);
/** /**
* Releases (and removes) the next thread waiting on this object * Wake up the next thread waiting on this object
* @return Pointer to the thread that was resumed, nullptr if no threads are waiting * @return Pointer to the thread that was resumed, nullptr if no threads are waiting
*/ */
Thread* ReleaseNextThread(); Thread* WakeupNextThread();
/// Releases all threads waiting on this object /// Wake up all threads waiting on this object
void ReleaseAllWaitingThreads(); void WakeupAllWaitingThreads();
private: private:
std::vector<Thread*> waiting_threads; ///< Threads waiting for this object to become available std::vector<Thread*> waiting_threads; ///< Threads waiting for this object to become available

View File

@ -53,7 +53,7 @@ void MutexAcquireLock(Mutex* mutex, Handle thread = GetCurrentThread()->GetHandl
*/ */
void ResumeWaitingThread(Mutex* mutex) { void ResumeWaitingThread(Mutex* mutex) {
// Find the next waiting thread for the mutex... // Find the next waiting thread for the mutex...
auto next_thread = mutex->ReleaseNextThread(); auto next_thread = mutex->WakeupNextThread();
if (next_thread != nullptr) { if (next_thread != nullptr) {
MutexAcquireLock(mutex, next_thread->GetHandle()); MutexAcquireLock(mutex, next_thread->GetHandle());
} else { } else {

View File

@ -70,7 +70,7 @@ ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count) {
// Notify some of the threads that the semaphore has been released // Notify some of the threads that the semaphore has been released
// stop once the semaphore is full again or there are no more waiting threads // stop once the semaphore is full again or there are no more waiting threads
while (!semaphore->ShouldWait() && semaphore->ReleaseNextThread() != nullptr) { while (!semaphore->ShouldWait() && semaphore->WakeupNextThread() != nullptr) {
semaphore->Acquire(); semaphore->Acquire();
} }

View File

@ -104,7 +104,7 @@ void Thread::Stop(const char* reason) {
ChangeReadyState(this, false); ChangeReadyState(this, false);
status = THREADSTATUS_DORMANT; status = THREADSTATUS_DORMANT;
ReleaseAllWaitingThreads(); WakeupAllWaitingThreads();
// Stopped threads are never waiting. // Stopped threads are never waiting.
wait_objects.clear(); wait_objects.clear();

View File

@ -90,7 +90,7 @@ static void TimerCallback(u64 timer_handle, int cycles_late) {
timer->signaled = true; timer->signaled = true;
// Resume all waiting threads // Resume all waiting threads
timer->ReleaseAllWaitingThreads(); timer->WakeupAllWaitingThreads();
if (timer->reset_type == RESETTYPE_ONESHOT) if (timer->reset_type == RESETTYPE_ONESHOT)
timer->signaled = false; timer->signaled = false;