Threading libsmbclient - a proposal.

Jeremy Allison jra at samba.org
Tue Apr 7 23:36:21 GMT 2009


On Tue, Apr 07, 2009 at 04:32:28PM -0700, 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. When *exactly* do you find a use for trylock ?
> 
> > Your pthread destroy_lock needs to free() the lock memory that you 
> > malloc'd; pthread_mutex_destroy() only deinitializes it, it doesn't 
> > actually free it.
> 
> Cool - thanks for the bug report. I did that in the tls code
> bug missed it in the lock code - fixed.

Fixed versions attached. I'll add the trylock once you've
convinced me we need it :-).

Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smb_threads.h
Type: text/x-chdr
Size: 3747 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090407/b41a4c3d/smb_threads.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smb_threads_internal.h
Type: text/x-chdr
Size: 1637 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090407/b41a4c3d/smb_threads_internal.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smb_threads.c
Type: text/x-csrc
Size: 2741 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090407/b41a4c3d/smb_threads-0001.bin


More information about the samba-technical mailing list