mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Set CaptureThread::thread to null after thread is released.
Was having a timing problem where ISR was still trying to signal thread after thread was nulled.
This commit is contained in:
parent
4a348e2c6c
commit
ca5dadab93
@ -85,13 +85,11 @@ public:
|
||||
}
|
||||
|
||||
~CaptureThread() {
|
||||
const auto thread_tmp = thread;
|
||||
|
||||
if( thread_tmp ) {
|
||||
if( thread ) {
|
||||
chThdTerminate(thread);
|
||||
chEvtSignal(thread, EVT_MASK_CAPTURE_THREAD);
|
||||
const auto success = chThdWait(thread);
|
||||
thread = nullptr;
|
||||
chThdTerminate(thread_tmp);
|
||||
chEvtSignal(thread_tmp, EVT_MASK_CAPTURE_THREAD);
|
||||
const auto success = chThdWait(thread_tmp);
|
||||
|
||||
if( !success ) {
|
||||
led_tx.on();
|
||||
|
Loading…
Reference in New Issue
Block a user