/* 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)
{
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) {