Skip to content

Commit ba836f2

Browse files
committed
Only calculate thread UUIDs if they are needed
MSP-11147 Only calculate thread UUIDs if the thread count exceeds EXPECTED_THREAD_COUNT_AROUND_SUITE.
1 parent ceb7a63 commit ba836f2

File tree

1 file changed

+4
-5
lines changed
  • lib/metasploit/framework/spec/threads

1 file changed

+4
-5
lines changed

lib/metasploit/framework/spec/threads/suite.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ def self.configure!
6969
end
7070

7171
thread_list = Metasploit::Framework::Spec::Threads::Suite.non_debugger_thread_list
72-
73-
thread_uuids = thread_list.map { |thread|
74-
thread[Metasploit::Framework::Spec::Threads::Suite::UUID_THREAD_LOCAL_VARIABLE]
75-
}.compact
76-
7772
thread_count = thread_list.count
7873

7974
if thread_count > EXPECTED_THREAD_COUNT_AROUND_SUITE
@@ -82,6 +77,10 @@ def self.configure!
8277
if LOG_PATHNAME.exist?
8378
caller_by_thread_uuid = Metasploit::Framework::Spec::Threads::Suite.caller_by_thread_uuid
8479

80+
thread_uuids = thread_list.map { |thread|
81+
thread[Metasploit::Framework::Spec::Threads::Suite::UUID_THREAD_LOCAL_VARIABLE]
82+
}.compact
83+
8584
thread_uuids.each do |thread_uuid|
8685
caller = caller_by_thread_uuid[thread_uuid]
8786

0 commit comments

Comments
 (0)