| 113 | }; |
| 114 | |
| 115 | InterestingProcess findRandomProcess(const env::Process& root) |
| 116 | { |
| 117 | for (auto&& c : root.children()) { |
| 118 | env::HandlePtr h = c.openHandleForWait(); |
| 119 | if (h) { |
| 120 | return {c, Interest::Weak, std::move(h)}; |
| 121 | } |
| 122 | |
| 123 | auto r = findRandomProcess(c); |
| 124 | if (r.handle) { |
| 125 | return r; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | return {}; |
| 130 | } |
| 131 | |
| 132 | // returns a process that's in the hidden list, or the top-level process if |
| 133 | // they're all hidden; returns an invalid process if the list is empty |
no test coverage detected