support lus thread_pool changes (#4127)

This commit is contained in:
briaguya 2024-05-06 22:08:11 -04:00 committed by GitHub
parent 8d3902a256
commit 52fad95a2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

@ -1 +1 @@
Subproject commit a5d84b29429dcd9b32fb1d8b169b6dd269e6c979
Subproject commit c2555d1cca2b7921c5b6790bbf0f6e66fe0433fb

View File

@ -1000,7 +1000,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);
}
@ -1091,7 +1091,7 @@ void SaveManager::LoadFile(int fileNum) {
void SaveManager::ThreadPoolWait() {
if (smThreadPool) {
smThreadPool->wait_for_tasks();
smThreadPool->wait();
}
}

View File

@ -39,7 +39,10 @@ typedef struct {
#include <functional>
#include <vector>
#include <filesystem>
#include "thread-pool/BS_thread_pool.hpp"
#define BS_THREAD_POOL_ENABLE_PRIORITY
#define BS_THREAD_POOL_ENABLE_PAUSE
#include <BS_thread_pool.hpp>
#include "z64save.h"