erebus

diff liberebus/src/threadpool.cc @ 34:d15ee526daa6

- changed the UI font, made it a bit smaller - fixed the text positioning in the status bar - added ThreadPool::clear to remove all pending jobs - fixed the TargetCamera matrix calculation to avoid singularities when the camera looks straight up or down. - fixed ommited normalization in TargetCamera's matrix calculation - added paths/sec display in the status bar
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 08 Jun 2014 08:12:05 +0300
parents b1fc96c71bcc
children 4b91c9a501d8
line diff
     1.1 --- a/liberebus/src/threadpool.cc	Sat Jun 07 14:21:56 2014 +0300
     1.2 +++ b/liberebus/src/threadpool.cc	Sun Jun 08 08:12:05 2014 +0300
     1.3 @@ -33,10 +33,7 @@
     1.4  ThreadPool::~ThreadPool()
     1.5  {
     1.6  #ifdef _MSC_VER
     1.7 -	workq_mutex.lock();
     1.8 -	workq.clear();
     1.9 -	qsize = 0;
    1.10 -	workq_mutex.unlock();
    1.11 +	clear_work();
    1.12  #endif
    1.13  
    1.14  	quit = true;
    1.15 @@ -79,6 +76,13 @@
    1.16  	workq_condvar.notify_all();
    1.17  }
    1.18  
    1.19 +void ThreadPool::clear_work()
    1.20 +{
    1.21 +	std::unique_lock<std::mutex> lock(workq_mutex);
    1.22 +	workq.clear();
    1.23 +	qsize = 0;
    1.24 +}
    1.25 +
    1.26  int ThreadPool::queued() const
    1.27  {
    1.28  	std::unique_lock<std::mutex> lock(workq_mutex);