mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Strict mode checking - no way to forget detaching now.
And if we forget to attach, boom. Hopefully I caught all of them.
This commit is contained in:
1 parent
916404f0e4
commit
b56eef487c
17 files changed
+84
-19
No files matched your search
@@ -133,6 +133,10 @@ static void WorkerThreadFunc(GlobalThreadContext *global, ThreadContext *thread)
|
||||
}
|
||||
SetCurrentThreadName(thread->name);
|
||||
|
||||
if (thread->type == TaskType::IO_BLOCKING) {
|
||||
AttachThreadToJNI();
|
||||
}
|
||||
|
||||
const bool isCompute = thread->type == TaskType::CPU_COMPUTE;
|
||||
const auto global_queue_size = [isCompute, &global]() -> int {
|
||||
return isCompute ? global->compute_queue_size.load() : global->io_queue_size.load();
|
||||
@@ -187,7 +191,9 @@ static void WorkerThreadFunc(GlobalThreadContext *global, ThreadContext *thread)
|
||||
}
|
||||
|
||||
// In case it got attached to JNI, detach it. Don't think this has any side effects if called redundantly.
|
||||
DetachThreadFromJNI();
|
||||
if (thread->type == TaskType::IO_BLOCKING) {
|
||||
DetachThreadFromJNI();
|
||||
}
|
||||
}
|
||||
|
||||
void ThreadManager::Init(int numRealCores, int numLogicalCoresPerCpu) {
|
||||
|
||||
Reference in new issue
Block a user