Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 11 months ago.
RTOS Thread --- attach_terminate_hook
Dears, is there any simple example how to use attach_terminate_hook function ?
Thank you
P.M.
1 Answer
8 years, 11 months ago.
Hi Pavel,
The documentation of the function is here. There is nothing fancy about this, just call the function with your callback as argument:
void on_thread_terminate(osThreadId thread_id) { 
  // your code here
}
int main() { 
  Thread::attach_terminate_hook(on_thread_terminate);
}
 
                            