+ static time_t last_run = 0L;
+ static int doing_pop3client = 0;
+
+ /*
+ * Run POP3 aggregation no more frequently than once every n seconds
+ */
+ if ( (time(NULL) - last_run) < config.c_net_freq ) {
+ return;
+ }
+
+ /*
+ * This is a simple concurrency check to make sure only one pop3client run
+ * is done at a time. We could do this with a mutex, but since we
+ * don't really require extremely fine granularity here, we'll do it
+ * with a static variable instead.
+ */
+ if (doing_pop3client) return;
+ doing_pop3client = 1;
+