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

Function thread_cow_update

freebsd/kern/kern_thread.c:816–837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

814}
815
816void
817thread_cow_update(struct thread *td)
818{
819 struct proc *p;
820 struct ucred *oldcred;
821 struct plimit *oldlimit;
822
823 p = td->td_proc;
824 oldlimit = NULL;
825 PROC_LOCK(p);
826 oldcred = crcowsync();
827 if (td->td_limit != p->p_limit) {
828 oldlimit = td->td_limit;
829 td->td_limit = lim_hold(p->p_limit);
830 }
831 td->td_cowgen = p->p_cowgen;
832 PROC_UNLOCK(p);
833 if (oldcred != NULL)
834 crfree(oldcred);
835 if (oldlimit != NULL)
836 lim_free(oldlimit);
837}
838
839/*
840 * Discard the current thread and exit from its context.

Callers 5

trapFunction · 0.85
trapFunction · 0.85
abort_handlerFunction · 0.85
syscallenterFunction · 0.85
astFunction · 0.85

Calls 4

crcowsyncFunction · 0.85
lim_holdFunction · 0.70
crfreeFunction · 0.70
lim_freeFunction · 0.70

Tested by

no test coverage detected