Use finer grained locks for install.
Narrow scope of merge locks to improve performance.
Instead of locking the DB for the entire package merge, just lock it
when we actually need to do so. Also add locks around conf_mem_file
updating and pkg_* phases.
Locking in pkg_* phases can be turned off with
FEATURES="no-ebuild-locks" if you use ebuilds that are careful not
to mess with each other during theses phases. The default is to leave
this locking enabled.
Given this new locking, I've improved the scheduler to run merge jobs
in parallel.
Time required for merging 348 packages with --usepkgonly:
- Before patch: 29m50s
- After patch: 10m2s
- After patch w/o locks: 7m9s
Change-Id: I63588c4cc59fa6fe2f8327ea1e4a9e71b241d4fe
Review URL: http://gerrit.chromium.org/gerrit/498