mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 10:09:32 +01:00
Android: Fix emuthread management to exit cleanly without hanging. Helps with task switching on Android.
This commit is contained in:
1 parent
b3a09791b1
commit
7f30037e45
8 files changed
+72
-17
No files matched your search
@@ -112,7 +112,7 @@ PrioritizedWorkQueueItem *PrioritizedWorkQueue::Pop() {
|
||||
static std::thread *workThread;
|
||||
|
||||
static void threadfunc(PrioritizedWorkQueue *wq) {
|
||||
setCurrentThreadName("PrioritizedWorkQueue");
|
||||
setCurrentThreadName("PrioQueue");
|
||||
while (true) {
|
||||
PrioritizedWorkQueueItem *item = wq->Pop();
|
||||
if (!item) {
|
||||
@@ -126,7 +126,7 @@ static void threadfunc(PrioritizedWorkQueue *wq) {
|
||||
}
|
||||
|
||||
void ProcessWorkQueueOnThreadWhile(PrioritizedWorkQueue *wq) {
|
||||
workThread = new std::thread(std::bind(&threadfunc, wq));
|
||||
workThread = new std::thread([=](){threadfunc(wq);});
|
||||
}
|
||||
|
||||
void StopProcessingWorkQueue(PrioritizedWorkQueue *wq) {
|
||||
@@ -135,5 +135,5 @@ void StopProcessingWorkQueue(PrioritizedWorkQueue *wq) {
|
||||
workThread->join();
|
||||
delete workThread;
|
||||
}
|
||||
workThread = 0;
|
||||
workThread = nullptr;
|
||||
}
|
||||
Reference in new issue
Block a user