[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1034-g786447d

Andrew Bartlett abartlet at samba.org
Wed Apr 15 01:47:30 GMT 2009

On Tue, 2009-04-14 at 19:36 +0000, simo wrote:
> On Tue, 2009-04-14 at 10:53 -0700, Jeremy Allison wrote:
> > 
> > Because it has to add the pointer onto globally
> > linked list, a static "HEAD" pointer inside the
> > talloc library. Now I could add a mutex around
> > that inside talloc, but I'm pretty sure we don't
> > want to add the SMB_THREAD_XX calls inside talloc.
> > 
> > I think talloc is thread safe so long as you avoid the
> > NULL context.
> ah right, I forgot that NULL actually uses the null_context ... I wonder
> why we do so though.
> why don't we let talloc(NULL, ..); generate a completely new context ?

Which is exactly what it does, unless you enable NULL tracking. 

The global variable null_context is actually NULL, creating no global
references, unless this debugging aid is enabled.

As it stands, talloc(NULL) is more thread safe than talloc_tos().  That
may change, but we should not misunderstand the current situation.

Andrew Bartlett

Andrew Bartlett
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20090415/e6739715/attachment.bin

More information about the samba-technical mailing list