You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/04/10 14:07:26 UTC
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request
#743: Minificpp 1169 - Simplify C2 metrics collection and reporting
bakaid commented on a change in pull request #743: Minificpp 1169 - Simplify C2 metrics collection and reporting
URL: https://github.com/apache/nifi-minifi-cpp/pull/743#discussion_r406770245
##########
File path: libminifi/src/utils/BackTrace.cpp
##########
@@ -80,25 +80,21 @@ BackTrace TraceResolver::getBackTrace(std::string thread_name, std::thread::nati
// lock so that we only perform one backtrace at a time.
#ifdef HAS_EXECINFO
std::lock_guard<std::mutex> lock(mutex_);
-
- caller_handle_ = pthread_self();
- thread_handle_ = thread_handle;
trace_ = BackTrace(std::move(thread_name));
- if (0 == thread_handle_ || pthread_equal(caller_handle_, thread_handle)) {
+ if (0 == thread_handle || pthread_equal(pthread_self(), thread_handle)) {
pull_trace();
} else {
- if (thread_handle_ == 0) {
+ if (thread_handle == 0) {
return std::move(trace_);
}
emplace_handler();
- if (pthread_kill(thread_handle_, SIGUSR2) != 0) {
+ std::unique_lock<std::mutex> ulock(trace_mutex_);
+ if (pthread_kill(thread_handle, SIGUSR2) != 0) {
return std::move(trace_);
}
- sigset_t mask;
- sigfillset(&mask);
- sigdelset(&mask, SIGUSR2);
- sigsuspend(&mask);
Review comment:
Nice catch.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services