19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/rex/thread_factory.rb', line 19
def self.spawn(name, crit, *args, &block)
if @@provider
if block
return @@provider.spawn(name, crit, *args){ |*args_copy| block.call(*args_copy) }
else
return @@provider.spawn(name, crit, *args)
end
else
t = nil
if block
t = ::Thread.new(*args){ |*args_copy| block.call(*args_copy) }
else
t = ::Thread.new(*args)
end
t[:tm_name] = name
t[:tm_crit] = crit
t[:tm_time] = ::Time.now
t[:tm_call] = caller
return t
end
end
|