Date: Fri, 27 Mar 2015 08:55:55 +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-10@freebsd.org Subject: svn commit: r280746 - stable/10/usr.sbin/bhyve Message-ID: <201503270855.t2R8tt60026332@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Mar 27 08:55:54 2015 New Revision: 280746 URL: https://svnweb.freebsd.org/changeset/base/280746 Log: MFC r280042: Close potential race on blockif_close(). Reported by: vangyzen Modified: stable/10/usr.sbin/bhyve/block_if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:54:55 2015 (r280745) +++ stable/10/usr.sbin/bhyve/block_if.c Fri Mar 27 08:55:54 2015 (r280746) @@ -579,7 +579,9 @@ blockif_close(struct blockif_ctxt *bc) /* * Stop the block i/o thread */ + pthread_mutex_lock(&bc->bc_mtx); bc->bc_closing = 1; + pthread_mutex_unlock(&bc->bc_mtx); pthread_cond_broadcast(&bc->bc_cond); for (i = 0; i < BLOCKIF_NUMTHR; i++) pthread_join(bc->bc_btid[i], &jval);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503270855.t2R8tt60026332>