an optimization that also fixes a reversion
authorJoey Hess <joeyh@joeyh.name>
Tue, 12 May 2015 22:34:49 +0000 (18:34 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 12 May 2015 22:34:49 +0000 (18:34 -0400)
commit643b233860408fad37482435a5abb348f144293e
treeb606f66e27f05edd3d1f9d395498b5d5bdcaacd7
parent1fd54e986a20edbb54be8f38e3d6686dc731d721
an optimization that also fixes a reversion

This is a little optimisation; avoid loading the info file for the
download of the current key when checking for other downloads.

The reversion it fixes is sorta strange.
a812d598ef90b3778258f197b2fcb86d51d83d72 broke checking for transfers
that were already in progress. Indeed, the transfer lock was not held
after getTransfers was called.

Why? I think it's magic in ghc's handling of getLock and setLock,
although it's hard to tell since those functions are almost entirely
undocumented as to their semantics.

Something, either the RTS (or maybe it's linux?) notices that the
same process has taken a lock and is now calling getLock on a FD attached
to the same file. So, it drops the lock.

So, this optimisation avoids that problematic behavior.
Logs/Transfer.hs