Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Jan 2001 15:58:08 +0900
From:      Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To:        freebsd-current@freebsd.org
Cc:        yokota@zodiac.mech.utsunomiya-u.ac.jp
Subject:   mtx_destroy() and MTX_COLD
Message-ID:  <200101050658.PAA11958@zodiac.mech.utsunomiya-u.ac.jp>

next in thread | raw e-mail | index | archive | help
In order to declare a mutex which will be used before malloc(9)
becomes available in the kernel, MUTEX_DECLARE() should be used, then
it should be initialized by passing the MTX_COLD flag to mtx_init(),
so that a statically allocated buffer will be used, instead of
malloc()ing a buffer, right?

Will it be safe to call mtx_destroy() for this mutex? 
/sys/kern/kern_mutex.c:mtx_destroy() seems to always try to free() the
buffer...

Kazu







To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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