Threading libsmbclient - a proposal.

Jeremy Allison jra at samba.org
Wed Apr 8 18:29:34 GMT 2009


On Wed, Apr 08, 2009 at 12:52:07AM +0000, simo wrote:
> On Tue, 2009-04-07 at 17:39 -0700, Jeremy Allison wrote:
> > On Tue, Apr 07, 2009 at 05:36:04PM -0700, Jeremy Allison wrote:
> > > On Wed, Apr 08, 2009 at 12:31:38AM +0000, simo wrote:
> > > > 
> > > > If you think you can add other types of locks later on without changing
> > > > the public API I see no problem going step by step.
> > > > But keep in mind that the huge macro (or my proposed define), moves all
> > > > that code into the API.
> > > 
> > > No, actually it doesn't - that's the nice thing about it !
> > 
> > In case I'm not being clear enough here, the huge macro
> > is a *sample* implementation of the public API, but it's
> > not the only one. Anyone can write an implementation for
> > any platform so long as it has the same semantics that
> > the vectored functions in the struct require.
> > 
> > Note the sample code in the macro doesn't make use
> > of the lock names or debugging __location__ information,
> > but another implementation could easily do so for
> > debuggin purposes.
> 
> Oh ok,
> I thought you wanted to include it into libsmbclient.h, my fault.

Ok, here is the modified version containing all
the comments. Changed _lock to _mutex to make
it clearer, removed RW lock stuff we're not currently
using, added static to big macro functions.

If this is ok, I'll commit and start implementing
the changes needed to thread libsmbclient.

Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smb_threads.h
Type: text/x-chdr
Size: 3775 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090408/aebdd70a/smb_threads.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smb_threads_internal.h
Type: text/x-chdr
Size: 1647 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090408/aebdd70a/smb_threads_internal.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smb_threads.c
Type: text/x-csrc
Size: 2744 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090408/aebdd70a/smb_threads-0001.bin


More information about the samba-technical mailing list