| 175 | EVENTHANDLER_LIST_DEFINE(thread_fini); |
| 176 | |
| 177 | static bool |
| 178 | thread_count_inc_try(void) |
| 179 | { |
| 180 | int nthreads_new; |
| 181 | |
| 182 | nthreads_new = atomic_fetchadd_int(&nthreads, 1) + 1; |
| 183 | if (nthreads_new >= maxthread - 100) { |
| 184 | if (priv_check_cred(curthread->td_ucred, PRIV_MAXPROC) != 0 || |
| 185 | nthreads_new >= maxthread) { |
| 186 | atomic_subtract_int(&nthreads, 1); |
| 187 | return (false); |
| 188 | } |
| 189 | } |
| 190 | return (true); |
| 191 | } |
| 192 | |
| 193 | static bool |
| 194 | thread_count_inc(void) |
no test coverage detected