| 290 | } |
| 291 | |
| 292 | comm::RetCode SyncCtrl::Flush(const int sub_id, const int queue_id) { |
| 293 | auto opt(impl_->store->GetStoreOption()); |
| 294 | |
| 295 | if (!sub_id || sub_id > opt->nsub || queue_id >= opt->nqueue) |
| 296 | return comm::RetCode::RET_ERR_ARG; |
| 297 | |
| 298 | size_t idx; |
| 299 | GetIdx(opt->nsub, sub_id, queue_id, idx); |
| 300 | |
| 301 | std::lock_guard<mutex> lock_guard(impl_->locks[idx]); |
| 302 | |
| 303 | auto &&item(impl_->buf[idx]); |
| 304 | if (0 != msync(&item, ((size_t)(&item.reserved[0]) - (size_t)(&item)), MS_SYNC)) { |
| 305 | QLErr("msync err %s", strerror(errno)); |
| 306 | return comm::RetCode::RET_ERR_SYS; |
| 307 | } |
| 308 | return comm::RetCode::RET_OK; |
| 309 | } |
| 310 | |
| 311 | comm::RetCode SyncCtrl::GetBackLogByCursorID(const int queue_id, |
| 312 | const uint64_t cursor_id, int &backlog) { |
nothing calls this directly
no test coverage detected