Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 494934

Summary: multibuild eclasses should use `flock` for locking
Product: Gentoo Linux Reporter: SpanKY <vapier>
Component: EclassesAssignee: Michał Górny <mgorny>
Status: RESOLVED OBSOLETE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description SpanKY gentoo-dev 2013-12-21 09:39:29 UTC
rather than the `ln` hack (which requires $BASHPID which is in bash-4.0+), it should simply use `flock`

(
flock -x 9 || die
... do stuff that needs the lock
) 9>/path/to/common/lock/file

bonus: this won't burn the cpu
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-21 09:46:28 UTC
Been there, Prefix was unhappy, bug #466554.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-11 16:40:07 UTC
We should probably go for a locking helper in eutils that has cases for multiple OS-es.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-23 22:06:36 UTC
(git-r3 no longer needs locking)
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-01-09 15:09:47 UTC
Locking is no longer used in the eclass.