From owner-freebsd-current Thu Jan 4 22:50:45 2001 From owner-freebsd-current@FreeBSD.ORG Thu Jan 4 22:50:43 2001 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by hub.freebsd.org (Postfix) with ESMTP id 98BDF37B400 for ; Thu, 4 Jan 2001 22:50:42 -0800 (PST) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:i5YJrBViwLH0F6gjy8rPtd1FCxp3o13k@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by outmail.utsunomiya-u.ac.jp (8.11.0/3.7Wpl2) with ESMTP id f056oUH10455 for ; Fri, 5 Jan 2001 15:50:30 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:/F1F1u41C83GsWpnN6TBOKKa0vIFAX/E@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by zodiac.mech.utsunomiya-u.ac.jp (8.9.3+3.2W/3.7W/zodiac-May2000) with ESMTP id PAA11958; Fri, 5 Jan 2001 15:58:09 +0900 (JST) Message-Id: <200101050658.PAA11958@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 Date: Fri, 05 Jan 2001 15:58:08 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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