32 catch (
const invalid_argument &error)
34 Log::add(Log::DEBUG4,
string(
"PausableThread::run(): catch invalid argument exception '") +
36 _exception_thrown = INVALID_ARGUMENT_EXCEPTION;
37 _invarg_excep = error;
39 catch (
const runtime_error &error)
41 Log::add(Log::DEBUG4,
string(
"PausableThread::run(): catch runtime error exception '") +
43 _exception_thrown = RUNTIME_ERROR_EXCEPTION;
46 catch (
const out_of_range &error)
48 Log::add(Log::DEBUG4,
string(
"PausableThread::run(): catch out of range exception '") +
50 _exception_thrown = OUT_OF_RANGE_EXCEPTION;
51 _outrange_excep = error;
53 catch (
const logic_error &error)
55 Log::add(Log::DEBUG4,
string(
"PausableThread::run(): catch logic error exception '") +
57 _exception_thrown = LOGIC_ERROR_EXCEPTION;
60 catch (
const exception &error)
62 Log::add(Log::DEBUG4,
string(
"PausableThread::run(): catch standart exception '") +
64 _exception_thrown = STANDART_EXCEPTION;
68 Log::add(Log::DEBUG4,
string(
"PausableThread::run(): catch unknown exception"));
69 _exception_thrown = UNKNOWN_EXCEPTION;
75 if (_control == _pause)
76 throw runtime_error(
"PausableThread::pause(): Thread is already told to pause");
79 if (_status != notstarted && wait)
87 if (_control != _pause)
88 throw runtime_error(
"PausableThread::waitUntilPaused(): Threat is not told to be paused");
91 _waitUntilPausedCondition.wait(&mutex);
98 throw runtime_error(
"PausableThread::resume(): Thread is already told to resume");
99 if(_status == running)
100 throw runtime_error(
"PausableThread::resume(): Thread is already running");
102 if (_pausecount == 0)
105 _pauseCondition.wakeAll();
111 if (_control == _pause)
115 _waitUntilPausedCondition.wakeOne();
116 _pauseCondition.wait(&_pauseMutex);
123 switch (_exception_thrown)
125 case INVALID_ARGUMENT_EXCEPTION:
132 throw _outrange_excep;
declaration of a pausable QThread
void rethrowException() const
rethrow the thrown exception
void pause(bool block=false)
pause the thread
void waitUntilPaused()
waits until thread is paused
virtual ~PausableThread()
destructor
void resume()
resume the thread
void pausePoint()
point where the thread will be paused
contains a logger for cass