[Pacemaker] async_conn

Andrew Beekhof andrew at beekhof.net
Sat Mar 6 07:06:53 UTC 2010


On Fri, Mar 5, 2010 at 8:29 PM, Alan Jones <falancluster at gmail.com> wrote:
> I'm trying to follow the code in lib/ais/plugin.c
> In many functions the first argument "conn" is assigned to a local
> "async_conn" which is never modified, e.g.:
>
> void pcmk_notify(void *conn, ais_void_ptr *msg)
> {
>     const AIS_Message *ais_msg = msg;
>     char *data = get_ais_data(ais_msg);
>     void *async_conn = conn;
> ...
>
> I'm not clear what this accomplishes.  Both conn and async_conn are local in
> scope.
> Both point to memory which seems to be a string with the name of the host
> that sourced this message.
> The assignment does *not* copy the memory, i.e. if multiple threads change
> the memory the values
> referenced within this function will change.
>
> Does anyone understand the author's intent here?

Its a hang-over from the openais' old IPC implementation.
It could probably be cleaned up and removed now.




More information about the Pacemaker mailing list