| 610 | } |
| 611 | |
| 612 | int |
| 613 | kern_thr_alloc(struct proc *p, int pages, struct thread **ntd) |
| 614 | { |
| 615 | |
| 616 | /* Have race condition but it is cheap. */ |
| 617 | if (p->p_numthreads >= max_threads_per_proc) { |
| 618 | ++max_threads_hits; |
| 619 | return (EPROCLIM); |
| 620 | } |
| 621 | |
| 622 | *ntd = thread_alloc(pages); |
| 623 | if (*ntd == NULL) |
| 624 | return (ENOMEM); |
| 625 | |
| 626 | return (0); |
| 627 | } |
no test coverage detected