method

exclusive

rails latest stable - Class: ActiveSupport::Concurrency::ShareLock
exclusive(purpose: nil, compatible: [], after_compatible: [], no_wait: false)
public

Execute the supplied block while holding the Exclusive lock. If no_wait is set and the lock is not immediately available, returns nil without yielding. Otherwise, returns the result of the block.

See start_exclusive for other options.