mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-17 14:04:22 +00: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:
@@ -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();
|
||||||
|
Reference in New Issue
Block a user