Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Sep 2005 18:55:38 +0200
From:      Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To:        hackers@freebsd.org
Subject:   dev_lock() question
Message-ID:  <20050929165538.GA20614@stud.fit.vutbr.cz>

next in thread | raw e-mail | index | archive | help
Hi,

dev_lock() looks this way:

void
dev_lock(void)
{
	if (!mtx_initialized(&devmtx))
		mtx_init(&devmtx, "cdev", NULL, MTX_DEF);
	mtx_lock(&devmtx);
}

I wonder why is the mtx_initialized checking necessary? shouldnt explicit
initialization be sufficient?

thnx for answer

roman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050929165538.GA20614>