module Sqreen::Backport::MutexOwned

Public Class Methods

supported?() click to toggle source
# File lib/sqreen/backport/mutex_owned.rb, line 10
def supported?
  Mutex.new.respond_to?(:owned?)
end

Public Instance Methods

owned?() click to toggle source
# File lib/sqreen/backport/mutex_owned.rb, line 15
def owned?
  locked? && synchronize { return false }
rescue ThreadError
  return true
end