Remove talloc from libwbclient

simo idra at samba.org
Sat Feb 6 17:40:47 MST 2010


On Sun, 2010-02-07 at 00:31 +0100, Volker Lendecke wrote:
> On Sat, Feb 06, 2010 at 02:02:15PM -0500, simo wrote:
> > A change in the API is usually a bad thing, the whole point of
> > libwbclient was to build an API/ABI that wouldn't change so that people
> > could use it. So, personally, I'd go with number 1, it may be a bit ugly
> > but it won't break the API.
> > 
> > Of course none of this is necessary if we make system talloc an explicit
> > dependency and stop statically linking in talloc (this is the real
> > issue, and it is an issue in any public library we want to build), then
> > the only thing you need to make sure of is that talloc is used in a
> > thread-safe way, which shouldn't be too difficult within libwbclient.
> 
> The problem is that you can't use talloc in a thread-safe
> way from within a library where you don't control access to
> the NULL context at all.
> 
> A different way to do this would be to have a thread-safe
> version of talloc_init() that we could use as a shared
> talloc parent in libwbclient, where we could control and
> mutex the access to it.

Yes this could very possibly be useful not just for libwbclient, but for
any user that wants to use talloc and also needs to use threads.
I think it's really worth considering.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list