void Buffer::Decoder::end() { requestInterruption(); if (!wait(2000)) { terminate(); } wait(); }
/* Kill this thread */ void Player::kill() { requestInterruption(); /* Fake a cmd, to leave properly */ mutex.lock(); queue.clear(); mutex.unlock(); cmdAvailable.release(1); }
pf_mcontroller::~pf_mcontroller() { //finish the thread requestInterruption(); if(!wait(3000)) { QDebug(QtWarningMsg) << "Can't quit thread, terminate"; terminate(); wait(); } QDebug(QtDebugMsg) << "THread is terminated"; //delete serial ports instances if(m_tx_port == m_rx_port) { delete m_tx_port; } else { delete m_tx_port; delete m_rx_port; } }
inline void stop() { requestInterruption(); }