MCPcopy Create free account
hub / github.com/F-Stack/f-stack / thread_count_inc

Function thread_count_inc

freebsd/kern/kern_thread.c:193–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193static bool
194thread_count_inc(void)
195{
196 static struct timeval lastfail;
197 static int curfail;
198
199 thread_reap();
200 if (thread_count_inc_try()) {
201 return (true);
202 }
203
204 thread_reap_all();
205 if (thread_count_inc_try()) {
206 return (true);
207 }
208
209 if (ppsratecheck(&lastfail, &curfail, 1)) {
210 printf("maxthread limit exceeded by uid %u "
211 "(pid %d); consider increasing kern.maxthread\n",
212 curthread->td_ucred->cr_ruid, curproc->p_pid);
213 }
214 return (false);
215}
216
217static void
218thread_count_sub(int n)

Callers 2

threadinitFunction · 0.85
thread_allocFunction · 0.85

Calls 5

thread_reapFunction · 0.85
thread_count_inc_tryFunction · 0.85
thread_reap_allFunction · 0.85
ppsratecheckFunction · 0.70
printfFunction · 0.70

Tested by

no test coverage detected