X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fmemory.c;h=6c97e190a7e12408da88b35e74e2e2625c067a15;hb=0ef165ecb57943e17a8ee8270df68ffb8d032e29;hp=c26c743fba5d327e845d4a258cb2091b8a48135b;hpb=b9de4087685a16f3c8dd1a5b719219ff14ad5b65;p=sliver-openvswitch.git diff --git a/lib/memory.c b/lib/memory.c index c26c743fb..6c97e190a 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -51,7 +51,10 @@ static void memory_init(void); /* Runs the memory monitor. * - * The client should call memory_should_report() afterward. */ + * The client should call memory_should_report() afterward. + * + * This function, and the remainder of this module's interface, should be + * called from only a single thread. */ void memory_run(void) { @@ -137,8 +140,10 @@ memory_report(const struct simap *usage) ds_init(&s); compose_report(usage, &s); - if (want_report && s.length) { - VLOG_INFO("%s", ds_cstr(&s)); + if (want_report) { + if (s.length) { + VLOG_INFO("%s", ds_cstr(&s)); + } want_report = false; } if (n_conns) {