| 211 | } |
| 212 | |
| 213 | comm::RetCode KeepMasterThread::GetLockID(int &lock_id) { |
| 214 | const int topic_id{impl_->scheduler->GetTopicID()}; |
| 215 | |
| 216 | comm::RetCode ret; |
| 217 | |
| 218 | shared_ptr<const config::LockConfig> lock_config; |
| 219 | if (comm::RetCode::RET_OK != (ret = config::GlobalConfig::GetThreadInstance()->GetLockConfig(topic_id, lock_config))) { |
| 220 | QLErr("GetLockConfig ret %d", as_integer(ret)); |
| 221 | return ret; |
| 222 | } |
| 223 | |
| 224 | set<int> lock_ids; |
| 225 | if (comm::RetCode::RET_OK != (ret = lock_config->GetAllLockID(lock_ids))) { |
| 226 | QLErr("GetAllLockID ret %d", as_integer(ret)); |
| 227 | return ret; |
| 228 | } |
| 229 | |
| 230 | if (lock_ids.empty()) { |
| 231 | QLErr("GetAllLockID lock_ids empty"); |
| 232 | return comm::RetCode::RET_ERR_RANGE_LOCK; |
| 233 | |
| 234 | } |
| 235 | |
| 236 | lock_id = *lock_ids.begin(); |
| 237 | return comm::RetCode::RET_OK; |
| 238 | } |
| 239 | |
| 240 | |
| 241 | } // namespace scheduler |
nothing calls this directly
no test coverage detected