| 33 | int64_t GetThisThreadGlobalId() { return *MutThreadLocalUniqueGlobalId(); } |
| 34 | |
| 35 | ThreadGlobalIdGuard::ThreadGlobalIdGuard(int64_t thread_global_id) |
| 36 | : old_thread_global_id_(GetThisThreadGlobalId()) { |
| 37 | if (old_thread_global_id_ != kThreadGlobalIdMain) { |
| 38 | CHECK_EQ(old_thread_global_id_, thread_global_id) |
| 39 | << "nested ThreadGlobalIdGuard disabled. old thread_global_id: " << old_thread_global_id_ |
| 40 | << ", new thread_global_id:" << thread_global_id; |
| 41 | } |
| 42 | *MutThreadLocalUniqueGlobalId() = thread_global_id; |
| 43 | } |
| 44 | |
| 45 | ThreadGlobalIdGuard::~ThreadGlobalIdGuard() { |
| 46 | *MutThreadLocalUniqueGlobalId() = old_thread_global_id_; |
nothing calls this directly
no test coverage detected