Date: Sun, 15 Mar 2015 16:18:04 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280042 - head/usr.sbin/bhyve Message-ID: <201503151618.t2FGI4E4038385@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sun Mar 15 16:18:03 2015 New Revision: 280042 URL: https://svnweb.freebsd.org/changeset/base/280042 Log: Close potential race on blockif_close(). Reported by: vangyzen MFC after: 2 weeks Modified: head/usr.sbin/bhyve/block_if.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Sun Mar 15 16:09:39 2015 (r280041) +++ head/usr.sbin/bhyve/block_if.c Sun Mar 15 16:18:03 2015 (r280042) @@ -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?201503151618.t2FGI4E4038385>