git-svn-id: svn://db.shs.com.ru/pip@746 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -159,6 +159,24 @@ bool PIIODevice::setOption(PIIODevice::DeviceOption o, bool yes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PIIODevice::stopThreadedRead() {
|
||||||
|
#ifdef FREERTOS
|
||||||
|
PIThread::stop(true);
|
||||||
|
#else
|
||||||
|
PIThread::terminate();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PIIODevice::stopThreadedWrite() {
|
||||||
|
#ifdef FREERTOS
|
||||||
|
write_thread.stop(true);
|
||||||
|
#else
|
||||||
|
write_thread.terminate();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIIODevice::_init() {
|
void PIIODevice::_init() {
|
||||||
opened_ = init_ = thread_started_ = false;
|
opened_ = init_ = thread_started_ = false;
|
||||||
raise_threaded_read_ = true;
|
raise_threaded_read_ = true;
|
||||||
@@ -221,8 +239,12 @@ void PIIODevice::terminate() {
|
|||||||
thread_started_ = false;
|
thread_started_ = false;
|
||||||
if (!init_) return;
|
if (!init_) return;
|
||||||
if (isRunning()) {
|
if (isRunning()) {
|
||||||
|
#ifdef FREERTOS
|
||||||
|
stop(true);
|
||||||
|
#else
|
||||||
stop();
|
stop();
|
||||||
PIThread::terminate();
|
PIThread::terminate();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ public:
|
|||||||
void startThreadedRead(ReadRetFunc func) {ret_func_ = func; if (!isRunning()) PIThread::start();}
|
void startThreadedRead(ReadRetFunc func) {ret_func_ = func; if (!isRunning()) PIThread::start();}
|
||||||
|
|
||||||
//! Stop threaded read
|
//! Stop threaded read
|
||||||
void stopThreadedRead() {PIThread::terminate();}
|
void stopThreadedRead();
|
||||||
|
|
||||||
|
|
||||||
//! Return \b true if threaded write is started
|
//! Return \b true if threaded write is started
|
||||||
@@ -187,7 +187,7 @@ public:
|
|||||||
void startThreadedWrite() {if (!write_thread.isRunning()) write_thread.startOnce();}
|
void startThreadedWrite() {if (!write_thread.isRunning()) write_thread.startOnce();}
|
||||||
|
|
||||||
//! Stop threaded write
|
//! Stop threaded write
|
||||||
void stopThreadedWrite() {write_thread.terminate();}
|
void stopThreadedWrite();
|
||||||
|
|
||||||
//! Clear threaded write task queue
|
//! Clear threaded write task queue
|
||||||
void clearThreadedWriteQueue() {write_thread.lock(); write_queue.clear(); write_thread.unlock();}
|
void clearThreadedWriteQueue() {write_thread.lock(); write_queue.clear(); write_thread.unlock();}
|
||||||
|
|||||||
Reference in New Issue
Block a user