Class: Thread

Inherits:
Object
  • Object
show all
Defined in:
lib/dispatch_queue.rb

Class Method Summary collapse

Class Method Details

.exclusiveObject



40
41
42
43
44
45
46
# File 'lib/dispatch_queue.rb', line 40

def self.exclusive
  old_value = Thread.critical
  Thread.critical = true
  yield
ensure
  Thread.critical = old_value
end