Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Common/Thread/ThreadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ static void WorkerThreadFunc(GlobalThreadContext *global, TaskThreadContext *thr
}
SetCurrentThreadName(thread->name);

// Should we do this on all threads?
if (thread->type == TaskType::IO_BLOCKING) {
AttachThreadToJNI();
}
Expand Down
2 changes: 1 addition & 1 deletion Common/Thread/ThreadManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// To help smart scheduling.
enum class TaskType {
CPU_COMPUTE,
IO_BLOCKING,
IO_BLOCKING, // NOTE: Only these can access scoped storage on Android (they initialize the JNI context).
DEDICATED_THREAD, // These can never get stuck in queue behind others, but are more expensive to launch. Cannot use I/O.
};

Expand Down
2 changes: 1 addition & 1 deletion Core/Screenshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ ScreenshotResult TakeGameScreenshot(Draw::DrawContext *draw, const Path &filenam
}

if (callback) {
g_threadManager.EnqueueTask(new IndependentTask(TaskType::CPU_COMPUTE, TaskPriority::LOW,
g_threadManager.EnqueueTask(new IndependentTask(TaskType::IO_BLOCKING, TaskPriority::LOW,
[buf = std::move(buf), callback = std::move(callback), filename, fmt, w, h]() {
u8 *flipbuffer = nullptr;
u32 width = w, height = h;
Expand Down
Loading