| 31 | } |
| 32 | |
| 33 | void class_counter::inc(const char *name) { |
| 34 | if (lock_) { |
| 35 | lock_->lock(); |
| 36 | } |
| 37 | |
| 38 | std::map<std::string, long long>::iterator it = names_.find(name); |
| 39 | if (it == names_.end()) { |
| 40 | names_[name] = 1; |
| 41 | } else { |
| 42 | it->second++; |
| 43 | } |
| 44 | |
| 45 | if (lock_) { |
| 46 | lock_->unlock(); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | void class_counter::dec(const char *name) { |
| 51 | if (lock_) { |