Funtion initialization locked in loop
Commit 0cc92371 introduces function initialization bug when functions request interfaces mutually (e.g. Function1 request interface from Function2, and Function2 requests interface from Function1).
In these cases, function initialization is stuck looping, since the _initialized flag is updated after initialization is completed, on init_():
bool function1_initialized = false;
void init_function1(void)
{
if (!function1_initialized) {
// Call user code startup function
function1_startup();
// Iterate over all synchronous RIs, and call their parent's
// init function. Multiple calls are prevented by the "init" guard. -> no longer guaranteed
extern void init_function2(void);
init_function2();
#ifdef __unix__
puts ("[TASTE] Initialization completed for function Function1");
#endif
function1_initialized = true;
}
}
bool function2_initialized = false;
void init_function2(void)
{
if (!function2_initialized) {
// Call user code startup function
function2_startup();
// Iterate over all synchronous RIs, and call their parent's
// init function. Multiple calls are prevented by the "init" guard.
extern void init_function1(void);
init_function1();
#ifdef __unix__
puts ("[TASTE] Initialization completed for function Function2");
#endif
function2_initialized = true;
}
}