[patch] Fix refcounting and locking in dbus-connection
John (J5) Palmieri
johnp at redhat.com
Tue Sep 5 15:27:43 PDT 2006
On Tue, 2006-09-05 at 18:03 -0400, Havoc Pennington wrote:
> John (J5) Palmieri wrote:
> > I removed it from the files in bus/ and make check still passed. We
> > still need it for dbus-connection.c and dbus-bus.c but I could rename it
> > to _dbus_connection_close_shared or _dbus_connection_close_no_check.
> >
>
> It's fine for dbus-connection.c / dbus-bus.c (basically it should only
> be used by the "owner" of a shared connection). close_shared might be a
> better name, indeed - it could even have an assert(connection->shared)
> in it. Though... does that "shared" flag mean shared in the sense of
> dbus-connection.c or shared in the sense of dbus-bus.c or both?
>
> Come to think of it if dbus-bus.c does a connection_open() instead of
> open_private() then some connections could be "owned" by both bus.c and
> connection.c - did you already handle that case? I'm too lazy to look at
> the patch again ;-)
Yes. They are both handled. Basically shared means I am shared by
connection_open and am in the shared_connections hash. In the case of a
bus connection we take another ref so the connection doesn't go away
until the bus is done with it also.
--
John (J5) Palmieri <johnp at redhat.com>
More information about the dbus
mailing list