| 104 | } |
| 105 | |
| 106 | bool SetCurrentThreadName(const std::string& name) { |
| 107 | auto& instance = ThreadDataRegistry<std::string>::GetInstance(); |
| 108 | const auto& cur_name = instance.GetCurrentThreadData(); |
| 109 | if (!cur_name.empty() || name.empty() || name == kDefaultThreadName) { |
| 110 | return false; |
| 111 | } |
| 112 | instance.SetCurrentThreadData(name); |
| 113 | VLOG(4) << __func__ << " " << name; |
| 114 | return true; |
| 115 | } |
| 116 | |
| 117 | uint32_t GetProcessId() { |
| 118 | #if defined(_MSC_VER) |