diff options
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/BitTorrent/Sessions.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/Sessions.hs b/src/Network/BitTorrent/Sessions.hs index f2035066..9713f438 100644 --- a/src/Network/BitTorrent/Sessions.hs +++ b/src/Network/BitTorrent/Sessions.hs | |||
@@ -297,7 +297,8 @@ defaultThreadCount = 1000 | |||
297 | enterSwarm :: SwarmSession -> IO () | 297 | enterSwarm :: SwarmSession -> IO () |
298 | enterSwarm SwarmSession {..} = do | 298 | enterSwarm SwarmSession {..} = do |
299 | MSem.wait (activeThreads clientSession) | 299 | MSem.wait (activeThreads clientSession) |
300 | MSem.wait vacantPeers | 300 | MSem.wait vacantPeers `onException` |
301 | MSem.signal (activeThreads clientSession) | ||
301 | 302 | ||
302 | leaveSwarm :: SwarmSession -> IO () | 303 | leaveSwarm :: SwarmSession -> IO () |
303 | leaveSwarm SwarmSession {..} = mask_ $ do | 304 | leaveSwarm SwarmSession {..} = mask_ $ do |