Skip to content

Commit

Permalink
#1938: use current_time argument in runnable
Browse files Browse the repository at this point in the history
  • Loading branch information
stmcgovern committed Oct 18, 2022
1 parent ac71224 commit 57775d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/vt/runnable/runnable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,46 +212,46 @@ void RunnableNew::run() {
#endif
}

void RunnableNew::begin() {
void RunnableNew::begin(TimeType current_time) {
contexts_.setcontext.begin();
if (contexts_.has_td) contexts_.td.begin();
if (contexts_.has_col) contexts_.col.begin();
if (contexts_.has_lb) contexts_.lb.begin();
if (contexts_.has_lb) contexts_.lb.begin(current_time);
#if vt_check_enabled(trace_enabled)
if (contexts_.has_trace) contexts_.trace.begin();
#endif
}

void RunnableNew::end() {
void RunnableNew::end(TimeType current_time) {
contexts_.setcontext.end();
if (contexts_.has_td) contexts_.td.end();
if (contexts_.has_col) contexts_.col.end();
if (contexts_.has_cont) contexts_.cont.end();
if (contexts_.has_lb) contexts_.lb.end();
if (contexts_.has_lb) contexts_.lb.end(current_time);
#if vt_check_enabled(trace_enabled)
if (contexts_.has_trace) contexts_.trace.end();
#endif
}

void RunnableNew::suspend() {
void RunnableNew::suspend(TimeType current_time) {
#if vt_check_enabled(fcontext)
contexts_.setcontext.suspend();
if (contexts_.has_td) contexts_.td.suspend();
if (contexts_.has_col) contexts_.col.suspend();
if (contexts_.has_lb) contexts_.lb.suspend();
if (contexts_.has_lb) contexts_.lb.suspend(current_time);

# if vt_check_enabled(trace_enabled)
if (contexts_.has_trace) contexts_.trace.suspend();
# endif
#endif
}

void RunnableNew::resume() {
void RunnableNew::resume(TimeType current_time) {
#if vt_check_enabled(fcontext)
contexts_.setcontext.resume();
if (contexts_.has_td) contexts_.td.resume();
if (contexts_.has_col) contexts_.col.resume();
if (contexts_.has_lb) contexts_.lb.resume();
if (contexts_.has_lb) contexts_.lb.resume(current_time);

# if vt_check_enabled(trace_enabled)
if (contexts_.has_trace) contexts_.trace.resume();
Expand Down
8 changes: 4 additions & 4 deletions src/vt/runnable/runnable.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,25 +236,25 @@ struct RunnableNew {
* \internal \brief Loop through all the contexts associated with this
* runnable and invoke \c begin() on them.
*/
void begin();
void begin(TimeType current_time = 0.0);

/**
* \internal \brief Loop through all the contexts associated with this
* runnable and invoke \c end() on them.
*/
void end();
void end(TimeType current_time = 0.0);

/**
* \internal \brief Loop through all the contexts associated with this
* runnable and invoke \c suspend() on them.
*/
void suspend();
void suspend(TimeType current_time = 0.0);

/**
* \internal \brief Loop through all the contexts associated with this
* runnable and invoke \c resume() on them.
*/
void resume();
void resume(TimeType current_time = 0.0);

public:
/**
Expand Down

0 comments on commit 57775d0

Please sign in to comment.