Only calculate thread UUIDs if they are needed

MSP-11147

Only calculate thread UUIDs if the thread count exceeds
EXPECTED_THREAD_COUNT_AROUND_SUITE.
bug/bundler_fix
Luke Imhoff 2014-11-17 09:17:44 -06:00
parent ceb7a63a5c
commit ba836f2383
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 4 additions and 5 deletions

View File

@ -69,11 +69,6 @@ module Metasploit
end
thread_list = Metasploit::Framework::Spec::Threads::Suite.non_debugger_thread_list
thread_uuids = thread_list.map { |thread|
thread[Metasploit::Framework::Spec::Threads::Suite::UUID_THREAD_LOCAL_VARIABLE]
}.compact
thread_count = thread_list.count
if thread_count > EXPECTED_THREAD_COUNT_AROUND_SUITE
@ -82,6 +77,10 @@ module Metasploit
if LOG_PATHNAME.exist?
caller_by_thread_uuid = Metasploit::Framework::Spec::Threads::Suite.caller_by_thread_uuid
thread_uuids = thread_list.map { |thread|
thread[Metasploit::Framework::Spec::Threads::Suite::UUID_THREAD_LOCAL_VARIABLE]
}.compact
thread_uuids.each do |thread_uuid|
caller = caller_by_thread_uuid[thread_uuid]