mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-08 17:40:31 +00:00
Close potential race on blockif_close().
Reported by: vangyzen MFC after: 2 weeks
This commit is contained in:
parent
7315946b80
commit
f2e62de7d9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=280042
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue