| 814 | } |
| 815 | |
| 816 | void |
| 817 | thread_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. |
no test coverage detected