socsvn commit: r254775 - soc2013/zcore/head/usr.sbin/bhyve
zcore at FreeBSD.org
zcore at FreeBSD.org
Sun Jul 14 06:52:29 UTC 2013
Author: zcore
Date: Sun Jul 14 06:52:28 2013
New Revision: 254775
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=254775
Log:
fix block_if two bugs
1. add missing pthread_mutex_unlock() after pthread_cond_wait()
2. add missing pthread_cond_signal() before pthread_join()
Modified:
soc2013/zcore/head/usr.sbin/bhyve/block_if.c
Modified: soc2013/zcore/head/usr.sbin/bhyve/block_if.c
==============================================================================
--- soc2013/zcore/head/usr.sbin/bhyve/block_if.c Sun Jul 14 04:42:35 2013 (r254774)
+++ soc2013/zcore/head/usr.sbin/bhyve/block_if.c Sun Jul 14 06:52:28 2013 (r254775)
@@ -159,14 +159,13 @@
pthread_mutex_lock(&bc->bc_mtx);
}
pthread_cond_wait(&bc->bc_cond, &bc->bc_mtx);
+ pthread_mutex_unlock(&bc->bc_mtx);
/*
* Check ctxt status here to see if exit requested
*/
- if (bc->bc_closing) {
- pthread_mutex_unlock(&bc->bc_mtx);
+ if (bc->bc_closing)
pthread_exit(NULL);
- }
}
/* Not reached */
@@ -247,7 +246,7 @@
pthread_create(&bc->bc_btid, NULL, blockif_thr, bc);
- snprintf(tname, sizeof(tname), "%s blk-%s", vmname, ident);
+ snprintf(tname, sizeof(tname), "%s blk-%s", vmname, ident);
pthread_set_name_np(bc->bc_btid, tname);
return (bc);
@@ -321,6 +320,7 @@
* Stop the block i/o thread
*/
bc->bc_closing = 1;
+ pthread_cond_signal(&bc->bc_cond);
pthread_join(bc->bc_btid, &jval);
/* XXX Cancel queued i/o's ??? */
More information about the svn-soc-all
mailing list