Date: Fri, 27 Nov 2015 14:40:59 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r291386 - stable/9/sys/rpc Message-ID: <201511271440.tAREexvh055836@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Nov 27 14:40:59 2015 New Revision: 291386 URL: https://svnweb.freebsd.org/changeset/base/291386 Log: MFC r291061: Improve locking of sg_threadcount. Modified: stable/9/sys/rpc/svc.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/rpc/svc.c ============================================================================== --- stable/9/sys/rpc/svc.c Fri Nov 27 14:40:21 2015 (r291385) +++ stable/9/sys/rpc/svc.c Fri Nov 27 14:40:59 2015 (r291386) @@ -1292,7 +1292,9 @@ svc_new_thread(SVCGROUP *grp) SVCPOOL *pool = grp->sg_pool; struct thread *td; + mtx_lock(&grp->sg_lock); grp->sg_threadcount++; + mtx_unlock(&grp->sg_lock); kthread_add(svc_thread_start, grp, pool->sp_proc, &td, 0, 0, "%s: service", pool->sp_name); } @@ -1325,12 +1327,12 @@ svc_run(SVCPOOL *pool) } /* Starting threads */ + pool->sp_groups[0].sg_threadcount++; for (g = 0; g < pool->sp_groupcount; g++) { grp = &pool->sp_groups[g]; for (i = ((g == 0) ? 1 : 0); i < grp->sg_minthreads; i++) svc_new_thread(grp); } - pool->sp_groups[0].sg_threadcount++; svc_run_internal(&pool->sp_groups[0], TRUE); /* Waiting for threads to stop. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511271440.tAREexvh055836>