| 39 | } |
| 40 | |
| 41 | bool fiber_mutex::deadlock(fiber_mutex_stats& out) |
| 42 | { |
| 43 | ACL_FIBER_MUTEX_STATS *stats = acl_fiber_mutex_deadlock(); |
| 44 | |
| 45 | if (stats == NULL) { |
| 46 | return false; |
| 47 | } |
| 48 | |
| 49 | for (size_t i = 0; i < stats->count; i++) { |
| 50 | fiber_mutex_stat stat; |
| 51 | stat.fb = new fiber(stats->stats[i].fiber); |
| 52 | stat.waiting = stats->stats[i].waiting; |
| 53 | |
| 54 | for (size_t j = 0; j < stats->stats[i].count; j++) { |
| 55 | ACL_FIBER_MUTEX* mutex = stats->stats[i].holding[j]; |
| 56 | stat.holding.push_back(mutex); |
| 57 | } |
| 58 | |
| 59 | out.stats.push_back(stat); |
| 60 | } |
| 61 | |
| 62 | acl_fiber_mutex_stats_free(stats); |
| 63 | return true; |
| 64 | } |
| 65 | |
| 66 | static void show(const fiber_mutex_stat& s) |
| 67 | { |
nothing calls this directly
no test coverage detected