remove printf for debugging, remove semaphore from thread

This commit is contained in:
Dario 2019-10-10 06:52:48 +02:00
parent 77b7251502
commit c40cef59f5
3 changed files with 8 additions and 8 deletions

View File

@ -22,7 +22,7 @@ namespace UniLib {
CPUSheduler::~CPUSheduler()
{
printf("[CPUSheduler::~CPUSheduler]\n");
//printf("[CPUSheduler::~CPUSheduler]\n");
for(int i = 0; i < mThreadCount; i++) {
if (mThreads[i]) {
delete mThreads[i];
@ -30,7 +30,7 @@ namespace UniLib {
}
delete[] mThreads;
mThreadCount = 0;
printf("[CPUSheduler::~CPUSheduler] finished\n");
//printf("[CPUSheduler::~CPUSheduler] finished\n");
}
int CPUSheduler::sheduleTask(TaskPtr task)

View File

@ -6,7 +6,7 @@ namespace UniLib {
namespace lib {
Thread::Thread(const char* threadName/* = NULL*/, bool createInConstructor/* = true*/)
: mPocoThread(nullptr), semaphore(1), exitCalled(false)
: mPocoThread(nullptr), exitCalled(false)
{
if (createInConstructor) init(threadName);
}
@ -26,14 +26,14 @@ namespace UniLib {
{
//Post Exit to Thread
exitCalled = true;
printf("[Thread::~Thread] before semaphore wait\n");
//printf("[Thread::~Thread] before semaphore wait\n");
//semaphore.wait();
printf("[Thread::~Thread] after semaphore wait, before condSignal\n");
//printf("[Thread::~Thread] after semaphore wait, before condSignal\n");
condSignal();
printf("[Thread::~Thread] after condSignal, before thread join\n");
//printf("[Thread::~Thread] after condSignal, before thread join\n");
//SDL_Delay(500);
mPocoThread->join();
printf("[Thread::~Thread] after thread join\n");
//printf("[Thread::~Thread] after thread join\n");
//SDL_WaitThread(thread, NULL);
//LOG_WARNING_SDL();
delete mPocoThread;

View File

@ -69,7 +69,7 @@ namespace UniLib {
Poco::Mutex mutex;
Poco::Thread* mPocoThread;
Poco::Condition condition;
Poco::Semaphore semaphore;
//Poco::Semaphore semaphore;
bool exitCalled;
};