mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-09-29 02:57:33 +00:00
Changed TacosThread termination to work correctly; fixed bugs in the testing
This commit is contained in:
@@ -81,21 +81,26 @@ namespace sta
|
||||
// Infinite loop allowing quick restarts of this thread after termination.
|
||||
while (true)
|
||||
{
|
||||
// The thread has to wait until the startup has been completed.
|
||||
// The thread has to wait until the system startup has been completed.
|
||||
rtos::waitForStartupEvent();
|
||||
|
||||
// Wait for a thread start flag.
|
||||
wait(STA_RTOS_THREAD_FLAG_START);
|
||||
|
||||
// Call user-defined initialization code.
|
||||
running_ = true;
|
||||
init();
|
||||
|
||||
// Run the thread until the termination flag is set.
|
||||
while (!resetTerminationRequest())
|
||||
// Run the thread until the termination flag is set. Reset this
|
||||
while (!isTerminationRequested())
|
||||
{
|
||||
func();
|
||||
}
|
||||
|
||||
// Clear the termination request flag for this thread.
|
||||
deleteTerminationRequest();
|
||||
|
||||
// Call user-defined cleanup code.
|
||||
cleanup();
|
||||
running_ = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user