1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Zero the local-variable mutexes before we call mtx_init() on them,

failing to do this may lead mtx_init() to belive they have already
been initialized.

Detected by:	Marc Recht <marc@informatik.uni-bremen.de>
This commit is contained in:
Poul-Henning Kamp 2002-09-28 19:38:29 +00:00
parent 8b223ac209
commit 079a527a3d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104107

View File

@ -83,6 +83,7 @@ g_up_procbody(void)
struct thread *tp = FIRST_THREAD_IN_PROC(p);
struct mtx mymutex;
bzero(&mymutex, sizeof mymutex);
mtx_init(&mymutex, "g_up", MTX_DEF, 0);
mtx_lock(&mymutex);
tp->td_base_pri = PRIBIO;
@ -107,6 +108,7 @@ g_down_procbody(void)
struct thread *tp = FIRST_THREAD_IN_PROC(p);
struct mtx mymutex;
bzero(&mymutex, sizeof mymutex);
mtx_init(&mymutex, "g_down", MTX_DEF, 0);
mtx_lock(&mymutex);
tp->td_base_pri = PRIBIO;