diff options
Diffstat (limited to 'activerecord/lib/active_record/transactions.rb')
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 937955dd72..d6b99008ee 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -96,14 +96,14 @@ module ActiveRecord end end - def lock_mutex + def lock_mutex#:nodoc: Thread.current['open_transactions'] ||= 0 TRANSACTION_MUTEX.lock if Thread.current['open_transactions'] == 0 Thread.current['start_db_transaction'] = (Thread.current['open_transactions'] == 0) Thread.current['open_transactions'] += 1 end - def unlock_mutex + def unlock_mutex#:nodoc: Thread.current['open_transactions'] -= 1 TRANSACTION_MUTEX.unlock if Thread.current['open_transactions'] == 0 end |