/*Some function must be called from the main thread. if g_sync_command==THREAD_WAITING a function is waiting to be processed*/ void g_process_waiting_function(void) { tc_mutex_lock(g_sync_mutex); if (g_sync_command != 0) { if (g_sync_func != 0) { if (g_sync_command == THREAD_WAITING) { g_sync_result = g_sync_func(g_sync_param1, g_sync_param2); } } g_sync_command = 0; } tc_mutex_unlock(g_sync_mutex); }
void APP_CC g_process_waiting_function(void) { tc_mutex_lock(g_sync_mutex); if (g_sync_command != 0) { if (g_sync_func != 0) { if (g_sync_command == 100) { g_sync_result = g_sync_func(g_sync_param1, g_sync_param2); } } g_sync_command = 0; } tc_mutex_unlock(g_sync_mutex); }