The idea is good, but it needs solid implementation and testing.


On Wed, Dec 25, 2013 at 4:08 PM, Grzesiek Kolodziejczyk <
notifications@github.com> wrote:

> In app/models/build/locking.rb:
>
> > @@ -0,0 +1,42 @@
> > +module Build
> > +  module Locking
> > +    extend self
> > +
> > +    # Create an exclusive lock and yield
> > +    def lock(lock_name, options = {})
> > +      build_mutex(lock_name, options).with_lock do
> > +        yield
> > +      end
> > +    end
> > +
> > +    # Create a lock and yield, other threads waiting for the same lock
> > +    # will return when the lock is done without doing any work
> > +    #
> > +    # Only the first thread will get the result of the block returned,
>
> I removed lock_once, it was overcomplicating things :)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/rails-assets/rails-assets/pull/86/files#r8551069>
> .
>