MCPcopy Create free account
hub / github.com/Tencent/phxqueue / ClearCursorID

Method ClearCursorID

phxqueue/store/syncctrl.cpp:275–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273
274
275comm::RetCode SyncCtrl::ClearCursorID(const int sub_id, const int queue_id) {
276 auto opt = impl_->store->GetStoreOption();
277
278 if (!sub_id || sub_id > opt->nsub || queue_id >= opt->nqueue)
279 return comm::RetCode::RET_ERR_ARG;
280
281 size_t idx;
282 GetIdx(opt->nsub, sub_id, queue_id, idx);
283
284 lock_guard<mutex> lock_guard(impl_->locks[idx]);
285
286 auto &&item(impl_->buf[idx]);
287 memset(&item, 0, sizeof(item));
288
289 return comm::RetCode::RET_OK;
290}
291
292comm::RetCode SyncCtrl::Flush(const int sub_id, const int queue_id) {
293 auto opt(impl_->store->GetStoreOption());

Callers

nothing calls this directly

Calls 2

GetIdxFunction · 0.85
GetStoreOptionMethod · 0.80

Tested by

no test coverage detected