<div>HI:</div>
<div> </div>
<div>I want to extend mnesia 's lock to add this function "mnesia:lock(LockItem,LockType,ConditionFun)" .</div>
<div> </div>
<div>This function works in this way: If a table 's record passes the ConditionFun test,the the record is locked.</div>
<div> </div>
<div>Eg.</div>
<div>I have a user table with the record: -record(user,{name,age}).</div>
<div> </div>
<div>I want to lock the user's whose name begines with 'a' ,I can code using my customized " mnesia:lock(LockItem,LockType,ConditionFun)"</div>
<div> </div>
<div>like this:</div>
<div> </div>
<div>ConditionFun=fun(U)-></div>
<div> if</div>
<div> U#<a href="http://user.name">user.name</a>=='a' -> true;</div>
<div> true->false</div>
<div> end</div>
<div>end </div>
<div>mnesia:lock(user,write,ConditionFun).</div>
<div> </div>
<div>that is I want to lock part of the table. </div>
<div> </div>
<div>Have anyone done this before? How shall I extend the mensia lock? Any information will be helpful, I 'm quite unfamiliar with mnesia lock system.</div>
<div> </div>
<div> </div>