2012/3/13 Rainer Gerhards <[email protected]>: >> So I came to the conclusion that 16cc84 was not my case. In addition, >> I suppose the enforcement in 8d2f66 is not a good way to fix the >> problem about uninitialized counters. Callers of AddCounter() are >> supposed to call, if necessary, STATSCOUNTER_INIT precedingly to do >> initialization protected by mutex. The problems in new versions are >> that plugins/imptcp/imptcp.c, plugins/imudp/imudp.c and tcpsrv.c miss >> the call of STATSCOUNTER_INIT, while action.c, >> plugins/imuxsock/imuxsock.c, >> plugins/omelasticsearch/omelasticsearch.c, runtime/queue.c are OK. The >> enforcement coexisting with STATSCOUNTER_INIT is confusing, and not >> documented as well. > > Thanks again for the analysis. I guess the interface was not well done in the > first place, as obviously even I misused it after a couple of weeks. I think > I will change it so that AddCounter() will receive an additional parameter > which tells if init is required or not. That should prevent further > confusion. Any comments on that?
STATSCOUNTER_INIT takes a mutex as well, will you consider that? Then it requires two additional parameters. > > Rainer > _______________________________________________ > rsyslog mailing list > http://lists.adiscon.net/mailman/listinfo/rsyslog > http://www.rsyslog.com/professional-services/ Thanks, Kaiwang _______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com/professional-services/

