workPool: don't use SDL

This commit is contained in:
tildearrow 2023-09-06 19:41:54 -05:00
parent c1b6aed04b
commit 7e50ffe1f0

View file

@ -21,8 +21,6 @@
#include "../ta-log.h" #include "../ta-log.h"
#include <thread> #include <thread>
#include <SDL.h>
void* _workThread(void* inst) { void* _workThread(void* inst) {
((DivWorkThread*)inst)->run(); ((DivWorkThread*)inst)->run();
return NULL; return NULL;
@ -150,7 +148,7 @@ void DivWorkPool::wait() {
workThreads[i].notify.set_value(); workThreads[i].notify.set_value();
workThreads[i].lock.unlock(); workThreads[i].lock.unlock();
} catch (std::exception& e) { } catch (std::exception& e) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,"EXCEPTION ON WAIT",e.what(),NULL); logE("ERROR IN THREAD SYNC! %s",e.what());
abort(); abort();
} }
} }
@ -158,12 +156,9 @@ void DivWorkPool::wait() {
std::this_thread::yield(); std::this_thread::yield();
// wait // wait
//SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,"Error","waiting on future.",NULL);
future.wait(); future.wait();
//SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,"Error","waited - reset promise.",NULL);
notify=std::promise<void>(); notify=std::promise<void>();
//SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,"Error","YES",NULL);
pos=0; pos=0;
} }