Commit f8bb790f authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - remove obsolete m_FinishRequested flag from WThreadedRunner

parent 101f07de
......@@ -94,7 +94,7 @@ void WLogger::setLogFileName( std::string fileName )
void WLogger::addLogMessage( std::string message, std::string source, LogLevel level )
{
if ( m_LogLevel > level || m_FinishRequested )
if ( m_LogLevel > level || m_shutdownFlag() )
{
return;
}
......@@ -158,7 +158,7 @@ void WLogger::threadMain()
// NOTE: in DEBUG mode, we do not use the process queue, since it prints messages delayed and is, therefore, not very usable during debugging.
#ifndef DEBUG
// Since the modules run in a separate thread: such loops are possible
while ( !m_FinishRequested )
while ( !m_shutdownFlag() )
{
processQueue();
// do fancy stuff
......
......@@ -33,7 +33,6 @@ WThreadedRunner::WThreadedRunner():
m_shutdownFlag( new WConditionOneShot, false )
{
// initialize members
m_FinishRequested = false;
}
WThreadedRunner::~WThreadedRunner()
......@@ -69,7 +68,6 @@ void WThreadedRunner::requestStop()
notifyStop();
// then signal it
m_FinishRequested = true;
m_shutdownFlag( true );
}
......
......@@ -98,11 +98,6 @@ protected:
*/
boost::thread m_thread;
/**
* True if thread should end execution. NOTE: do not use this. Use m_shutdownFlag instead.
*/
bool m_FinishRequested;
/**
* Give remaining execution timeslice to another thread.
*/
......
......@@ -31,7 +31,7 @@
#include "../WThreadedRunner.h"
/**
/**
* Class implementing a simple worker thread, since proper testing of WThreadedRunner itself is not usable.
*/
class WThreadedRunnerImpl: public WThreadedRunner
......@@ -45,7 +45,7 @@ protected:
virtual void threadMain()
{
// Since the modules run in a separate thread: such loops are possible
while ( !m_FinishRequested )
while ( !m_shutdownFlag() )
{
// do fancy stuff
sleep( 1 );
......
......@@ -276,7 +276,7 @@ protected:
virtual void moduleMain()
{
// Since the modules run in a separate thread: such loops are possible
while ( !m_FinishRequested )
while ( !m_shutdownFlag() )
{
// do fancy stuff
sleep( 1 );
......
......@@ -319,7 +319,6 @@ void WMEEGView::moduleMain()
if( !openCustomWidget() )
{
// Shut down module if widget could not be opened.
m_FinishRequested = true;
m_shutdownFlag.set( true );
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment