support lus thread_pool changes (#4127)
This commit is contained in:
Submodule libultraship updated: a5d84b2942...c2555d1cca
@@ -1000,7 +1000,7 @@ void SaveManager::SaveSection(int fileNum, int sectionID, bool threaded) {
|
|||||||
auto saveContext = new SaveContext;
|
auto saveContext = new SaveContext;
|
||||||
memcpy(saveContext, &gSaveContext, sizeof(gSaveContext));
|
memcpy(saveContext, &gSaveContext, sizeof(gSaveContext));
|
||||||
if (threaded) {
|
if (threaded) {
|
||||||
smThreadPool->push_task_back(&SaveManager::SaveFileThreaded, this, fileNum, saveContext, sectionID);
|
smThreadPool->detach_task(std::bind(&SaveManager::SaveFileThreaded, this, fileNum, saveContext, sectionID));
|
||||||
} else {
|
} else {
|
||||||
SaveFileThreaded(fileNum, saveContext, sectionID);
|
SaveFileThreaded(fileNum, saveContext, sectionID);
|
||||||
}
|
}
|
||||||
@@ -1091,7 +1091,7 @@ void SaveManager::LoadFile(int fileNum) {
|
|||||||
|
|
||||||
void SaveManager::ThreadPoolWait() {
|
void SaveManager::ThreadPoolWait() {
|
||||||
if (smThreadPool) {
|
if (smThreadPool) {
|
||||||
smThreadPool->wait_for_tasks();
|
smThreadPool->wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ typedef struct {
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <filesystem>
|
#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"
|
#include "z64save.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user