mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-01 18:42:40 +00:00
workPool: don't use SDL
This commit is contained in:
parent
c1b6aed04b
commit
7e50ffe1f0
1 changed files with 1 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue