MCPcopy Create free account
hub / github.com/apache/brpc / CheckBthreadScheSafety

Function CheckBthreadScheSafety

src/bthread/mutex.cpp:544–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542#define SUB_TLS_PTHREAD_LOCK_COUNT --tls_pthread_lock_count
543
544void CheckBthreadScheSafety() {
545 if (BAIDU_LIKELY(0 == tls_pthread_lock_count)) {
546 return;
547 }
548
549 // It can only be checked once because the counter is messed up.
550 LOG_BACKTRACE_ONCE(ERROR) << "bthread is suspended while holding "
551 << tls_pthread_lock_count << " pthread locks.";
552}
553#else
554#define ADD_TLS_PTHREAD_LOCK_COUNT ((void)0)
555#define SUB_TLS_PTHREAD_LOCK_COUNT ((void)0)

Callers 1

sched_toMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected