Subject: Re: kern/36673 (dubious code is sysmon_envsys)
To: None <xtraeme@NetBSD.org, gnats-admin@netbsd.org,>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 07/25/2007 00:20:02
The following reply was made to PR kern/36673; it has been noted by GNATS.

From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
To: juan@xtrarom.org
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/36673 (dubious code is sysmon_envsys)
Date: Wed, 25 Jul 2007 09:15:38 +0900 (JST)

 > On Mon, 23 Jul 2007 23:20:03 +0000 (UTC)
 > yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) wrote:
 > 
 > >  the usages of these mutexes are not obvious or documented.
 > >  
 > >  for example,
 > >  - i can't understand why sysmon_envsys_createplist acquires
 > >   sme_mtx in the loop.
 > 
 > I wanted to protect the sme_gtredata function callback, this one
 > is executed in the driver to refresh data in the sensors.
 
 protect from what?
 
 > One thing that is not clear to me is if I can allocate/deallocate memory
 > with a mutex held, can you please answer?
 
 as i already answered, it depends.
 don't do it if you are not sure.
 
 YAMAMOTO Takashi