# File lib/eventmachine.rb, line 899 899: def self::defer op, callback = nil 900: @need_threadqueue ||= 0 901: if @need_threadqueue == 0 902: @need_threadqueue = 1 903: require 'thread' 904: @threadqueue = Queue.new 905: @resultqueue = Queue.new 906: 20.times {|ix| 907: Thread.new { 908: my_ix = ix 909: loop { 910: op,cback = @threadqueue.pop 911: result = op.call 912: @resultqueue << [result, cback] 913: EventMachine.signal_loopbreak 914: } 915: } 916: } 917: end 918: 919: @threadqueue << [op,callback] 920: end