From 781538295ff7c056ffb5c19c283cfbacd91b243d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 14 Jun 2014 03:30:17 +0200 Subject: Limit the number of concurrent on-verify runs --- src/fastd.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/fastd.c') 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)) -- cgit v1.2.3