| 542 | #define SUB_TLS_PTHREAD_LOCK_COUNT --tls_pthread_lock_count |
| 543 | |
| 544 | void 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) |