[Bf-blender-cvs] [fff231daf04] profiler-editor: progress

Jacques Lucke noreply at git.blender.org
Thu Apr 29 11:30:47 CEST 2021


Commit: fff231daf047b985cffd2dbda96119ed018ceb63
Author: Jacques Lucke
Date:   Tue Apr 27 15:07:46 2021 +0200
Branches: profiler-editor
https://developer.blender.org/rBfff231daf047b985cffd2dbda96119ed018ceb63

progress

===================================================================

M	source/blender/blenlib/intern/profile.cc

===================================================================

diff --git a/source/blender/blenlib/intern/profile.cc b/source/blender/blenlib/intern/profile.cc
index 706076860e2..844a829be18 100644
--- a/source/blender/blenlib/intern/profile.cc
+++ b/source/blender/blenlib/intern/profile.cc
@@ -98,11 +98,14 @@ ProfileListener::~ProfileListener()
 
 void ProfileListener::flush_to_all()
 {
+  /* Todo: How to handle short lived threads? */
   std::scoped_lock lock{listeners_mutex, registered_threadlocals_mutex};
   for (ThreadLocalProfileData *data : registered_threadlocals) {
     RecordedProfile recorded_profile;
-    /* Todo load data from threadlocals. */
-    UNUSED_VARS(data);
+    data->queue_begins.consume(
+        [&](Span<ProfileTaskBegin> data) { recorded_profile.task_begins.extend(data); });
+    data->queue_ends.consume(
+        [&](Span<ProfileTaskEnd> data) { recorded_profile.task_ends.extend(data); });
     for (ProfileListener *listener : listeners) {
       listener->handle(recorded_profile);
     }



More information about the Bf-blender-cvs mailing list