tdb API issues

Jeremy Allison jra at samba.org
Fri Apr 3 16:47:17 GMT 2009


On Thu, Apr 02, 2009 at 07:30:45PM -0700, Howard Chu wrote:
>
> I'm not sure what's the point of OpenSSL asking the caller to pre-create 
> some number of global locks; IMO the library should create whatever locks 
> it needs and the caller shouldn't know about them at all. That's more the 
> flavor of the approach I took, otherwise it's basically the same: the 
> caller must call tdb_set_mutex() and provide it a structure which 
> contains a table of mutex function pointers. The tdb_set_mutex() function 
> will then create whatever locks it needs.

The reason it's easier to have the locks pre-created is you don't
then need to add lock initialization functions to existing code that
doesn't currently have an initialization call. We have a lot of old
global state that has no concept of locking so it makes it very easy
to add lock calls for global locks you know must already exist.

I'm assuming this is why openssl did this as well.

Jeremy.


More information about the samba-technical mailing list