From b0b04471f935d5a368fa3d380e97c9df96df287a Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Mon, 6 May 2024 22:08:11 -0400 Subject: [PATCH] support lus thread_pool changes (#4127) --- libultraship | 2 +- soh/soh/SaveManager.cpp | 4 ++-- soh/soh/SaveManager.h | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libultraship b/libultraship index a5d84b29429..c2555d1cca2 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit a5d84b29429dcd9b32fb1d8b169b6dd269e6c979 +Subproject commit c2555d1cca2b7921c5b6790bbf0f6e66fe0433fb diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 50d77917e60..4415cd7ddf0 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -1249,7 +1249,7 @@ void SaveManager::SaveSection(int fileNum, int sectionID, bool threaded) { auto saveContext = new SaveContext; memcpy(saveContext, &gSaveContext, sizeof(gSaveContext)); if (threaded) { - smThreadPool->push_task_back(&SaveManager::SaveFileThreaded, this, fileNum, saveContext, sectionID); + smThreadPool->detach_task(std::bind(&SaveManager::SaveFileThreaded, this, fileNum, saveContext, sectionID)); } else { SaveFileThreaded(fileNum, saveContext, sectionID); } @@ -1340,7 +1340,7 @@ void SaveManager::LoadFile(int fileNum) { void SaveManager::ThreadPoolWait() { if (smThreadPool) { - smThreadPool->wait_for_tasks(); + smThreadPool->wait(); } } diff --git a/soh/soh/SaveManager.h b/soh/soh/SaveManager.h index f7d0910f695..36b394a4864 100644 --- a/soh/soh/SaveManager.h +++ b/soh/soh/SaveManager.h @@ -40,7 +40,10 @@ typedef struct { #include #include #include -#include "thread-pool/BS_thread_pool.hpp" + +#define BS_THREAD_POOL_ENABLE_PRIORITY +#define BS_THREAD_POOL_ENABLE_PAUSE +#include #include "z64save.h"