[PATCH] afmongodb: Add stats locking.
Lock / unlock the stats when registering the counters. Reported-by: Costa Farber <costaf@wix.com> Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- modules/afmongodb/afmongodb.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules/afmongodb/afmongodb.c b/modules/afmongodb/afmongodb.c index f82f10e..9e155ed 100644 --- a/modules/afmongodb/afmongodb.c +++ b/modules/afmongodb/afmongodb.c @@ -439,12 +439,14 @@ afmongodb_dd_init(LogPipe *s) self->queue = log_dest_driver_acquire_queue(&self->super, afmongodb_dd_format_persist_name(self)); + stats_lock(); stats_register_counter(0, SCS_MONGODB | SCS_DESTINATION, self->super.super.id, afmongodb_dd_format_stats_instance(self), SC_TYPE_STORED, &self->stored_messages); stats_register_counter(0, SCS_MONGODB | SCS_DESTINATION, self->super.super.id, afmongodb_dd_format_stats_instance(self), SC_TYPE_DROPPED, &self->dropped_messages); + stats_unlock(); log_queue_set_counters(self->queue, self->stored_messages, self->dropped_messages); afmongodb_dd_start_thread(self); -- 1.7.0.4
On Tue, 2011-08-16 at 12:01 +0200, Gergely Nagy wrote:
Lock / unlock the stats when registering the counters.
Reported-by: Costa Farber <costaf@wix.com> Signed-off-by: Gergely Nagy <algernon@balabit.hu>
thanks, applied. -- Bazsi
participants (2)
-
Balazs Scheidler
-
Gergely Nagy