mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-15 18:00:28 -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
1 changed files with 4 additions and 6 deletions
|
@ -85,13 +85,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
~CaptureThread() {
|
~CaptureThread() {
|
||||||
const auto thread_tmp = thread;
|
if( thread ) {
|
||||||
|
chThdTerminate(thread);
|
||||||
if( thread_tmp ) {
|
chEvtSignal(thread, EVT_MASK_CAPTURE_THREAD);
|
||||||
|
const auto success = chThdWait(thread);
|
||||||
thread = nullptr;
|
thread = nullptr;
|
||||||
chThdTerminate(thread_tmp);
|
|
||||||
chEvtSignal(thread_tmp, EVT_MASK_CAPTURE_THREAD);
|
|
||||||
const auto success = chThdWait(thread_tmp);
|
|
||||||
|
|
||||||
if( !success ) {
|
if( !success ) {
|
||||||
led_tx.on();
|
led_tx.on();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue