mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-23 22:20:10 +00:00
Thread: Convert waiting_threads list from Handle to pointers
This commit is contained in:
parent
e19dc7e6f0
commit
5eb52c950d
@ -24,7 +24,7 @@ namespace Kernel {
|
||||
ResultVal<bool> Thread::WaitSynchronization() {
|
||||
const bool wait = status != THREADSTATUS_DORMANT;
|
||||
if (wait) {
|
||||
Handle thread = GetCurrentThread()->GetHandle();
|
||||
Thread* thread = GetCurrentThread();
|
||||
if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) {
|
||||
waiting_threads.push_back(thread);
|
||||
}
|
||||
@ -125,9 +125,7 @@ void Thread::Stop(const char* reason) {
|
||||
|
||||
ChangeReadyState(this, false);
|
||||
status = THREADSTATUS_DORMANT;
|
||||
for (Handle waiting_handle : waiting_threads) {
|
||||
Thread* waiting_thread = g_handle_table.Get<Thread>(waiting_handle);
|
||||
|
||||
for (Thread* waiting_thread : waiting_threads) {
|
||||
if (CheckWaitType(waiting_thread, WAITTYPE_THREADEND, GetHandle()))
|
||||
waiting_thread->ResumeFromWait();
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
Handle wait_handle;
|
||||
VAddr wait_address;
|
||||
|
||||
std::vector<Handle> waiting_threads;
|
||||
std::vector<Thread*> waiting_threads; // TODO(yuriks): Owned
|
||||
|
||||
std::string name;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user