git-svn-id: svn://db.shs.com.ru/pip@746 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2019-02-09 23:17:06 +00:00
parent fb8fadc1bc
commit 9d0f799278
2 changed files with 24 additions and 2 deletions

View File

@@ -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() {
opened_ = init_ = thread_started_ = false;
raise_threaded_read_ = true;
@@ -221,8 +239,12 @@ void PIIODevice::terminate() {
thread_started_ = false;
if (!init_) return;
if (isRunning()) {
#ifdef FREERTOS
stop(true);
#else
stop();
PIThread::terminate();
#endif
}
}