| 213 | // TODO: Add start-time. |
| 214 | // TODO: Track fragment ID. |
| 215 | class ThreadDescriptor { |
| 216 | public: |
| 217 | ThreadDescriptor() { } |
| 218 | ThreadDescriptor(string category, string name, int64_t thread_id) |
| 219 | : name_(std::move(name)), |
| 220 | category_(std::move(category)), |
| 221 | thread_id_(thread_id) {} |
| 222 | |
| 223 | const string& name() const { return name_; } |
| 224 | const string& category() const { return category_; } |
| 225 | int64_t thread_id() const { return thread_id_; } |
| 226 | |
| 227 | struct Comparator { |
| 228 | bool operator()(const ThreadDescriptor& rhs, const ThreadDescriptor& lhs) const { |
| 229 | return rhs.name() < lhs.name(); |
| 230 | } |
| 231 | }; |
| 232 | |
| 233 | private: |
| 234 | string name_; |
| 235 | string category_; |
| 236 | int64_t thread_id_; |
| 237 | }; |
| 238 | |
| 239 | struct ThreadIdHash { |
| 240 | size_t operator()(pthread_t thread_id) const noexcept { |