Skip to content

Commit

Permalink
feat: Allow trace call to be changed when children are running
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed Nov 19, 2024
1 parent 8ff8fae commit eb20a3a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rt/RtraceSimulManager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* RCSid $Id: RtraceSimulManager.h,v 2.17 2024/11/13 02:43:51 greg Exp $ */
/* RCSid $Id: RtraceSimulManager.h,v 2.18 2024/11/19 20:39:40 greg Exp $ */
/*
* RtraceSimulManager.h
*
Expand Down Expand Up @@ -138,10 +138,17 @@ class RtraceSimulManager : public RadSimulManager {
cookedCall = cb;
ccData = cb ? cd : NULL;
}
/// Set/change trace callback (before threading)
/// Set/change trace callback
void SetTraceCall(RayReportCall *cb, void *cd = NULL) {
if (cb == traceCall) {
if (cb) tcData = cd;
return;
}
int nt = NThreads();
if (nt > 1) SetThreadCount(1);
traceCall = cb;
tcData = cb ? cd : NULL;
if (nt > 1) SetThreadCount(nt);
}
/// Are we ready?
bool Ready() const {
Expand Down

0 comments on commit eb20a3a

Please sign in to comment.