[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha7-1530-g404327a
Jeremy Allison
jra at samba.org
Mon May 11 21:01:44 GMT 2009
On Sun, May 10, 2009 at 09:46:03PM -0500, Derrell Lipman wrote:
> commit d3434477e6d42432a0acf426fcfbe39eb11b1fd0
> Author: Derrell Lipman <derrell at dworkin.(none)>
> Date: Sun May 10 21:55:23 2009 -0400
>
> Replace external thread "once" with an internal implementation
>
> Jeremy, please check...
>
> - I'm in the process of providing an interface in libsmbclient to the
> recently-added threading capabilities. In the process, I discovered that
> different thread implementations have varying types for the variable passed
> to the thread_impl_once() function. pthreads, for example, uses type
> pthread_once_t. Since Samba needs to internally declare these variables, it
> would need to know the exact type required by each thread implementation's
> function. After considering multiple methods of obtaining an appropriately
> sized variable, I decided that for the basic "once" functionality required
> by Samba, it would be much simpler to just implement our own "once"
> functionality. We don't require cancellation points et all. This commit adds
> an smb_thread_once() function that is implemented using an internal
> mutex. The mutex itself uses the implementation's create_mutex
> function. This eliminates the need for the user to provide a smb_thread_once
> function pointer and the entire issue of that function's first parameter.
>
> Derrell
Derrell,
Thanks for writing this, it's a nicer way around
the pthread_once() problem I ran into. I'm only jealous
that I didn't think of it first :-).
Great work, thanks !
Jeremy
More information about the samba-technical
mailing list