Date: Fri, 3 May 2002 07:51:56 -0700 (PDT) From: Jonathan Mini <mini@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 10740 for review Message-ID: <200205031451.g43Epu600512@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=10740 Change 10740 by mini@mini_stylus on 2002/05/03 07:51:09 - Change thread_get(void) -> thread_alloc(void) to keep from conflicting with thread_get(struct proc *) in sys/kerne/kern_proc.c. - uma_zalloc(,M_WAITOK) will never return NULL, so don't bother testing for it. Affected files ... ... //depot/projects/kse/sys/kern/kern_fork.c#62 edit ... //depot/projects/kse/sys/kern/kern_thread.c#43 edit ... //depot/projects/kse/sys/sys/proc.h#97 edit Differences ... ==== //depot/projects/kse/sys/kern/kern_fork.c#62 (text+ko) ==== @@ -346,7 +346,7 @@ thread_single_end(); return (EAGAIN); } - td2 = thread_get(); + td2 = thread_alloc(); if (td2 == NULL) { uma_zfree(proc_zone, p2); nprocs--; ==== //depot/projects/kse/sys/kern/kern_thread.c#43 (text+ko) ==== @@ -142,7 +142,7 @@ * create one from the zone as per normal */ struct thread * -thread_get(void) +thread_alloc(void) { struct thread *td; @@ -155,15 +155,10 @@ } else { /* allocate the thread structure itself */ td = uma_zalloc(thread_zone, M_WAITOK); - - /* assuming we got one, allocate pages for the stack it needs */ - if (td) { - allocated_threads++; - pmap_new_thread(td); - cpu_thread_setup(td); - } else { - return (NULL); - } + + allocated_threads++; + pmap_new_thread(td); + cpu_thread_setup(td); } /* may need to set some stuff here.. re state? */ /* Make sure the zero'd section is in fact zero'd */ @@ -319,7 +314,7 @@ { struct thread *td2; - td2 = thread_get(); + td2 = thread_alloc(); if (td2) { CTR3(KTR_PROC, "thread_schedule_upcall: thread %p (pid %d, %s)", td, td->td_proc->p_pid, td->td_proc->p_comm); ==== //depot/projects/kse/sys/sys/proc.h#97 (text+ko) ==== @@ -797,7 +797,7 @@ int cpu_coredump(struct thread *, struct vnode *, struct ucred *); /* new in KSE */ -struct thread *thread_get(void); +struct thread *thread_alloc(void); void thread_free(struct thread *td); int cpu_export_context(struct thread *td); void cpu_free_kse_mdstorage(struct kse *kse); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205031451.g43Epu600512>