[patch] Add a level of abstraction to condvars and mutexes so we can initalize them late

John (J5) Palmieri johnp at redhat.com
Wed Aug 16 10:50:52 PDT 2006


Ah, yes, much nicer.  Patch attached.

On Wed, 2006-08-16 at 08:29 -0400, Havoc Pennington wrote:
> John (J5) Palmieri wrote:
> >>  /**
> >> + * This does the same thing as _dbus_mutex_new.  It however
> >> + * gives another level of indirection by allocating a pointer
> >> + * to point to the mutex location.  This allows the threading
> >> + * module to swap out dummy mutexes for real a real mutex so libraries
> >> + * can initialize threads even after the D-Bus API has been used.
> >> + *
> >> + * @returns the location of a new mutex or #NULL on OOM
> >> + */
> >> +DBusMutex**
> >> +_dbus_mutex_new_at_location (void)
> >> +{
> 
> Oh, I missed this before - what I'd intended was:
> 
> dbus_bool_t
> _dbus_mutex_new_at_location(DBusMutex **location_p)
> {
>    *location_p = _dbus_mutex_new();
>    ...
> }
> 
> then the patch would be even smaller...
> 
> Havoc
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-init-threads-late-3.patch
Type: text/x-patch
Size: 33993 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060816/ab19344b/dbus-init-threads-late-3-0001.bin


More information about the dbus mailing list