mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 01:00:09 +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() {
|
ResultVal<bool> Thread::WaitSynchronization() {
|
||||||
const bool wait = status != THREADSTATUS_DORMANT;
|
const bool wait = status != THREADSTATUS_DORMANT;
|
||||||
if (wait) {
|
if (wait) {
|
||||||
Handle thread = GetCurrentThread()->GetHandle();
|
Thread* thread = GetCurrentThread();
|
||||||
if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) {
|
if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) {
|
||||||
waiting_threads.push_back(thread);
|
waiting_threads.push_back(thread);
|
||||||
}
|
}
|
||||||
@ -125,9 +125,7 @@ void Thread::Stop(const char* reason) {
|
|||||||
|
|
||||||
ChangeReadyState(this, false);
|
ChangeReadyState(this, false);
|
||||||
status = THREADSTATUS_DORMANT;
|
status = THREADSTATUS_DORMANT;
|
||||||
for (Handle waiting_handle : waiting_threads) {
|
for (Thread* waiting_thread : waiting_threads) {
|
||||||
Thread* waiting_thread = g_handle_table.Get<Thread>(waiting_handle);
|
|
||||||
|
|
||||||
if (CheckWaitType(waiting_thread, WAITTYPE_THREADEND, GetHandle()))
|
if (CheckWaitType(waiting_thread, WAITTYPE_THREADEND, GetHandle()))
|
||||||
waiting_thread->ResumeFromWait();
|
waiting_thread->ResumeFromWait();
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ public:
|
|||||||
Handle wait_handle;
|
Handle wait_handle;
|
||||||
VAddr wait_address;
|
VAddr wait_address;
|
||||||
|
|
||||||
std::vector<Handle> waiting_threads;
|
std::vector<Thread*> waiting_threads; // TODO(yuriks): Owned
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user