mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
If threads limit is exceeded, increase the totoal number
of failures.
This commit is contained in:
parent
96ceb14462
commit
94ec9c0245
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184438
@ -76,6 +76,7 @@ suword_lwpid(void *addr, lwpid_t lwpid)
|
||||
#endif
|
||||
|
||||
extern int max_threads_per_proc;
|
||||
extern int max_threads_hits;
|
||||
|
||||
static int create_thread(struct thread *td, mcontext_t *ctx,
|
||||
void (*start_func)(void *), void *arg,
|
||||
@ -154,8 +155,10 @@ create_thread(struct thread *td, mcontext_t *ctx,
|
||||
p = td->td_proc;
|
||||
|
||||
/* Have race condition but it is cheap. */
|
||||
if (p->p_numthreads >= max_threads_per_proc)
|
||||
if (p->p_numthreads >= max_threads_per_proc) {
|
||||
++max_threads_hits;
|
||||
return (EPROCLIM);
|
||||
}
|
||||
|
||||
if (rtp != NULL) {
|
||||
switch(rtp->type) {
|
||||
|
Loading…
Reference in New Issue
Block a user