Threading libsmbclient - a proposal.

Howard Chu hyc at
Tue Apr 7 23:50:25 GMT 2009

Jeremy Allison wrote:
> On Tue, Apr 07, 2009 at 04:15:26PM -0700, Howard Chu wrote:
>> We often find the need for a trylock() op - fail immediately if the lock
>> is in use, instead of waiting.
> I thought about that one, but I don't see an immediate need
> for it in our code which will be mainly mutex locks around
> globals.

In that case, your prototype is deceptive - you advertise read locks and write 
locks, which are typically held for the duration of a lengthy operation, not 
just taken and released quickly. If you're only expecting these locks to be 
used to essentially support atomic test-and-set, then the RDLOCK and WRLOCK 
usage makes no sense.

   -- Howard Chu
   CTO, Symas Corp. 
   Director, Highland Sun
   Chief Architect, OpenLDAP

More information about the samba-technical mailing list