summaryrefslogtreecommitdiff
path: root/Command/MetaData.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-12 18:34:49 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-12 18:34:49 -0400
commitb38e187c0bfd6f4bcef6c235c555752aca193edc (patch)
treec241422b41862329c5a55b3f2c8c6cf01842db57 /Command/MetaData.hs
parent9995d85437a7a702756de21d3f92519c28f820d6 (diff)
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. b94eafec8c4a7868da753f9b22ca823552e9764c 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.
Diffstat (limited to 'Command/MetaData.hs')
0 files changed, 0 insertions, 0 deletions