Skip to content

Commit

Permalink
move suppression comments
Browse files Browse the repository at this point in the history
Signed-off-by: ISP akm <[email protected]>
  • Loading branch information
xygyo77 committed Jun 20, 2024
1 parent 5ddb07b commit 36e41cf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CARET_trace/src/trace_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,16 @@ bool TraceNode::is_recording_allowed() const
return status_ == TRACE_STATUS::RECORD;
}

// cppcheck-suppress unreachableCode
bool TraceNode::is_recording_allowed_init() const
{
return true;
// cppcheck-suppress-begin unreachableCode
std::shared_lock<std::shared_mutex> lock(mutex_);

// NOTE: Since PREPARE to RECORD is a continuous state transition
// with a return value of TRUE, no mutex is required.
// On the other hand, the transition to the PREPARE state is a boundary, so a mutex is required.
return status_ == TRACE_STATUS::RECORD || status_ == TRACE_STATUS::PREPARE;
// cppcheck-suppress-end unreachableCode
}

const TRACE_STATUS & TraceNode::get_status() const
Expand Down

0 comments on commit 36e41cf

Please sign in to comment.