MCPcopy Create free account
hub / github.com/apache/brpc / try_delete

Method try_delete

src/bthread/timer_thread.cpp:303–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303bool TimerThread::Task::try_delete() {
304 const uint32_t id_version = version_of_task_id(task_id);
305 if (version.load(butil::memory_order_relaxed) != id_version) {
306 CHECK_EQ(version.load(butil::memory_order_relaxed), id_version + 2);
307 butil::return_resource(slot_of_task_id(task_id));
308 return true;
309 }
310 return false;
311}
312
313template <typename T>
314static T deref_value(void* arg) {

Callers 1

runMethod · 0.80

Calls 4

version_of_task_idFunction · 0.85
slot_of_task_idFunction · 0.85
return_resourceFunction · 0.50
loadMethod · 0.45

Tested by

no test coverage detected