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

Function calc_remaining

freebsd/kern/kern_thread.c:1032–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1030}
1031
1032static int
1033calc_remaining(struct proc *p, int mode)
1034{
1035 int remaining;
1036
1037 PROC_LOCK_ASSERT(p, MA_OWNED);
1038 PROC_SLOCK_ASSERT(p, MA_OWNED);
1039 if (mode == SINGLE_EXIT)
1040 remaining = p->p_numthreads;
1041 else if (mode == SINGLE_BOUNDARY)
1042 remaining = p->p_numthreads - p->p_boundary_count;
1043 else if (mode == SINGLE_NO_EXIT || mode == SINGLE_ALLPROC)
1044 remaining = p->p_numthreads - p->p_suspcount;
1045 else
1046 panic("calc_remaining: wrong mode %d", mode);
1047 return (remaining);
1048}
1049
1050static int
1051remain_for_mode(int mode)

Callers 1

thread_singleFunction · 0.85

Calls 1

panicFunction · 0.70

Tested by

no test coverage detected