run file transfers in threads, not processes

This should fix OSX/BSD issues with not noticing transfer information
files with kqueue. Now that threads are used, the thread can manage the
transfer slot allocation and deallocation by itself; much cleaner.
This commit is contained in:
Joey Hess 2012-07-18 19:13:56 -04:00
parent eea0a3616c
commit cf47bb3f50
7 changed files with 29 additions and 53 deletions

View file

@ -74,9 +74,8 @@ runTransfer st dstatus slots t info = case (transferRemote info, associatedFile
(Nothing, _) -> noop
(_, Nothing) -> noop
(Just remote, Just file) -> do
tid <- inTransferSlot slots $
unsafeForkIOThreadState st $
transferprocess remote file
tid <- inTransferSlot slots st $
transferprocess remote file
now <- getCurrentTime
runThreadState st $ adjustTransfers dstatus $
M.insertWith' const t info