| 48 | } |
| 49 | |
| 50 | void class_counter::dec(const char *name) { |
| 51 | if (lock_) { |
| 52 | lock_->lock(); |
| 53 | } |
| 54 | |
| 55 | std::map<std::string, long long>::iterator it = names_.find(name); |
| 56 | if (it != names_.end()) { |
| 57 | if (--it->second == 0 && clean_) { |
| 58 | names_.erase(it); |
| 59 | } |
| 60 | } else { |
| 61 | logger_error("not find flag %s", name); |
| 62 | } |
| 63 | |
| 64 | if (lock_) { |
| 65 | lock_->unlock(); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | long long class_counter::count(const char *name) { |
| 70 | if (lock_) { |