summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Sessions.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Sessions.hs')
-rw-r--r--src/Network/BitTorrent/Sessions.hs3
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
297enterSwarm :: SwarmSession -> IO () 297enterSwarm :: SwarmSession -> IO ()
298enterSwarm SwarmSession {..} = do 298enterSwarm 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
302leaveSwarm :: SwarmSession -> IO () 303leaveSwarm :: SwarmSession -> IO ()
303leaveSwarm SwarmSession {..} = mask_ $ do 304leaveSwarm SwarmSession {..} = mask_ $ do