static void mm_lock_print_stat(const struct mm_thread *thread, const struct mm_lock_stat_set *stat_set, const struct mm_lock_stat *stat) { const char *name = mm_thread_getname(thread); if (stat_set->moreinfo != NULL) mm_verbose("lock %s (%s), %s, locked %llu, failed %llu", stat_set->location, stat_set->moreinfo, name, stat->lock_count, stat->fail_count); else mm_verbose("lock %s, %s, locked %llu, failed %llu", stat_set->location, name, stat->lock_count, stat->fail_count); }
/* Entry point for a task. */ static void mm_task_entry(void) { struct mm_task *task = mm_task_self(); #if ENABLE_TRACE mm_trace_context_prepare(&task->trace, "[%s][%d %s]", mm_thread_getname(mm_thread_self()), mm_task_getid(task), mm_task_getname(task)); #endif TRACE("enter task %s", mm_task_getname(task)); // Execute the task routine on an empty stack. mm_value_t result = task->start(task->start_arg); // Finish the task making sure there is no return from this point // as there is no valid stack frame above it. mm_task_exit(result); }