[Pacemaker] async_conn

Alan Jones falancluster at gmail.com
Fri Mar 5 14:29:02 EST 2010


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?
Thanks!
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clusterlabs.org/pipermail/pacemaker/attachments/20100305/7a6355d9/attachment-0001.html>


More information about the Pacemaker mailing list