[SR-Users] cfgutils lock / unlock + $sht() variables.

Vitaliy Aleksandrov vitalik.voip at gmail.com
Fri Jun 29 23:07:07 CEST 2012


Hi all,

I use $sht() pseudo-variabled provided by htable module for caching 
various information about sip customers. I thought that htable has some 
locking mechanism inside it and today while i was reading core-cookbook 
i payed attention to one example with the lock/unlock functions and $sht():

lock("calls-to::10.10.10.10");
$sht(a=>calls-to::10.10.10.10) =
             $sht(a=>calls-to::10.10.10.10) + 1;
unlock("calls-to::10.10.10.10");

According to that example an explicit locking mechanism should be used 
when i want to write something to a hash table.
On the other hand there are no locks in htable documentation.

So the question is when do the explicit locks should be used and for 
what purpose ?




More information about the sr-users mailing list