Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
19 | public function getThreadIds(int $pid) |
||
20 | { |
||
21 | /** |
||
22 | * @var string $full_path |
||
23 | * @var \SplFileInfo $item |
||
24 | */ |
||
25 | foreach (new \DirectoryIterator("/proc/{$pid}/task/") as $item) { |
||
26 | if (file_exists($item->getPathname()) === false) { |
||
27 | continue; |
||
28 | } |
||
29 | if (!is_numeric(basename($item->getPathname()))) { |
||
30 | continue; |
||
31 | } |
||
32 | yield (int)basename($item->getPathname()); |
||
33 | } |
||
36 |