Condition variable for outbound connection slots
authorPieter Wuille <pieter.wuille@gmail.com>
Wed, 4 Apr 2012 14:01:57 +0000 (16:01 +0200)
committerPieter Wuille <pieter.wuille@gmail.com>
Wed, 4 Apr 2012 15:24:13 +0000 (17:24 +0200)
commit092631f0ba0030dec1ccfa66e206fb2a6c9bf73b
treeb7e5a843ac4d215227b519efdd251d7b46fb13dc
parent712fd182b72b0f5a1bcf843f171c29ec0a49b50f
Condition variable for outbound connection slots

Keep a global counter for nOutbound, protected with its own waitable
critical section, and wait when all outbound slots are filled, rather
than polling.

This removes the (on average) 1 second delay between a lost connection
and a new connection attempt, and may speed up shutdowns.
src/net.cpp