summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-06-14 03:30:17 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-06-14 03:30:17 +0200
commit781538295ff7c056ffb5c19c283cfbacd91b243d (patch)
treeb5fc6f3be42c3839163638e513d315a64ffce550 /src/fastd.c
parent7915533147ddaaf5480e52b7d817e11b36348e4a (diff)
downloadfastd-781538295ff7c056ffb5c19c283cfbacd91b243d.tar
fastd-781538295ff7c056ffb5c19c283cfbacd91b243d.zip
Limit the number of concurrent on-verify runs
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fastd.c b/src/fastd.c
index 6512bf7..eff605e 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -534,6 +534,11 @@ static inline void init(int argc, char *argv[]) {
VECTOR_ALLOC(ctx.peers, 0);
VECTOR_ALLOC(ctx.async_pids, 0);
+#ifdef WITH_VERIFY
+ if (sem_init(&ctx.verify_limit, 0, VERIFY_LIMIT))
+ exit_errno("sem_init");
+#endif
+
if (pthread_attr_init(&ctx.detached_thread))
exit_errno("pthread_attr_init");
if (pthread_attr_setdetachstate(&ctx.detached_thread, PTHREAD_CREATE_DETACHED))